cleanup: global files cleanup

+ update LICENSE declaration in .config/nvim/after/ftplugin
+ remove vim.vim filetype settings
+ change mapping for buffer switch in neovim
This commit is contained in:
swy7ch 2020-05-20 17:03:00 +02:00 committed by swytch
parent 31981c9631
commit 30f254f6c3
25 changed files with 84 additions and 94 deletions

View File

@ -1,5 +1,5 @@
" groff filetype config
" Licence LGPL v3.0
" Licence GPLv3
inoremap <buffer> à \[`a]
inoremap <buffer> 'A \[`A]

View File

@ -1,5 +1,5 @@
" python filetype config
" LGPL v3.0 Licence
" Licence GPLv3
" proper PEP 8 indentation
set tabstop=4

View File

@ -1,5 +1,5 @@
" tex filetype config
" Licence LGPL v3.0
" Licence GPL3
" spellcheck enabled
setlocal spell spelllang=fr

View File

@ -1,4 +1,4 @@
" vim filetype config
" Licence LGPL v3.0
" Licence GPL3
setlocal spell spelllang=fr,en_us

View File

@ -1,4 +1,4 @@
" verilog indent removal
" Licence LGPL v3.0
" Licence GPLv3
noremap <leader><Enter> :w! \| :CoqRunToCursor<CR>

View File

@ -1,4 +0,0 @@
" vim filetype config
" Licence LGPL v3.0
let b:coc_pairs_disabled = ['"']

View File

@ -4,7 +4,7 @@
" Maintainer: David JULIEN <swy7ch@protonmail.com>
" Website: https://github.com/vim/vim/blob/master/src/syntax.c
" License: Vim License (see `:help license`)
" Last Updated: Sun 10 May 2020 12:25:20 PM CEST
" Last Updated: Fri 15 May 2020 03:37:00 PM CEST
" Generated by Colortemplate v2.0.0
@ -275,21 +275,21 @@ if s:t_Co >= 8
finish
endif
" Color: black #1d2021 0 Black
" Color: black #1d2021 0 Black
" Color: darkred #b73935 160 DarkRed
" Color: darkgreen #5a8471 2 DarkGreen
" Color: darkgreen #5a8471 2 DarkGreen
" Color: orange #f7a583 216 LightRed
" Color: darkblue #458588 24 DarkBlue
" Color: darkblue #458588 24 DarkBlue
" Color: darkmagenta #b16286 138 DarkMagenta
" Color: darkcyan #7cafa3 30 DarkCyan
" Color: darkcyan #7cafa3 30 DarkCyan
" Color: grey #7c6f64 243 Grey
" Color: darkgrey #373737 243 Grey
" Color: red #ea6962 203 Red
" Color: green #89b594 71 Green
" Color: green #89b594 71 Green
" Color: yellow #ffeca3 230 White
" Color: blue #7daea3 24 DarkCyan
" Color: blue #7daea3 24 DarkCyan
" Color: magenta #d3869b 181 Magenta
" Color: cyan #ace5d7 81 LightBlue
" Color: cyan #ace5d7 81 LightBlue
" Color: white #ebdbb2 229 LightYellow
" Term Colors: black darkred darkgreen orange darkblue darkmagenta darkcyan darkgrey
" Term Colors: grey red green yellow blue magenta cyan white

View File

@ -119,11 +119,11 @@ set smarttab
" 1 tab = 4 spaces
set tabstop=4
set shiftwidth=4 "for indent operations
set shiftwidth=4
" Indent and wrap rules
set autoindent
set wrap "wrap lines
set wrap
" Stop auto-commenting new line
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
@ -163,7 +163,7 @@ noremap <leader>s :source ~/.config/nvim/init.vim <CR>
" Circle through buffers
noremap <leader>n :bn<CR>
noremap <leader>p :bp<CR>
noremap <leader>b :bp<CR>
" Clear the search highlight
noremap <leader>q :nohl<CR>

View File

@ -11,21 +11,21 @@ Description: A simple yet customizable pastel colorscheme
# Color palette {{{
# Color name GUI Base256 Base16
Color: black #1d2021 0 Black
Color: black #1d2021 0 Black
Color: darkred #b73935 160 DarkRed
Color: darkgreen #5a8471 2 DarkGreen
Color: darkgreen #5a8471 2 DarkGreen
Color: orange #f7a583 216 LightRed
Color: darkblue #458588 24 DarkBlue
Color: darkblue #458588 24 DarkBlue
Color: darkmagenta #b16286 138 DarkMagenta
Color: darkcyan #7cafa3 30 DarkCyan
Color: darkcyan #7cafa3 30 DarkCyan
Color: grey #7c6f64 243 Grey
Color: darkgrey #373737 243 Grey
Color: red #ea6962 203 Red
Color: green #89b594 71 Green
Color: green #89b594 71 Green
Color: yellow #ffeca3 230 White
Color: blue #7daea3 24 DarkCyan
Color: blue #7daea3 24 DarkCyan
Color: magenta #d3869b 181 Magenta
Color: cyan #ace5d7 81 LightBlue
Color: cyan #ace5d7 81 LightBlue
Color: white #ebdbb2 229 LightYellow
# }}}

View File

@ -14,7 +14,6 @@ function! CurrentMode()
endfunction
function! ModeColor()
let g:modecolor={
\ 'n' : '%#NormalMode#',
\ 'v' : '%#VisualMode#',
@ -41,7 +40,6 @@ function! FileName()
endfunction
function! StatusLine()
let l:statusline=''
" Buffer number
@ -56,6 +54,7 @@ function! StatusLine()
let l:statusline.='%#File#'
let l:statusline.=FileName()
" File status
let l:statusline .= "%{&readonly?' [RO]':''}"
let l:statusline .= "%{&modified?' [MO]':''}"
@ -76,10 +75,7 @@ function! StatusLine()
let l:statusline.='%#WarningMsg#'
let l:statusline.="%{&fileencoding!='utf-8'?'['.&fileencoding.'] ':''}%*"
"setlocal statusline.=%#FileFormat#
"setlocal statusline.=\ %-7([%{&fileformat}]%)
" Depth
let l:statusline.='%#Percent#'
let l:statusline.='%03.p%%%* '
@ -88,16 +84,15 @@ function! StatusLine()
let l:statusline.='-%c-'
return l:statusline
endfunction
function! StatusLineNC()
let l:statusline=''
" Buffer number
let l:statusline.='[%n]'
" File name
" File name and status
let l:statusline.=' %t'
let l:statusline .= "%{&readonly?' [MO]':''}"
@ -109,11 +104,11 @@ function! StatusLineNC()
" Separation point between left and right aligned items.
let l:statusline.='%='
" Depth
let l:statusline.='%#Percent#'
let l:statusline.='%03.p%%'
return l:statusline
endfunction
function! UpdateInactiveWindows()

View File

@ -14,7 +14,7 @@
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
HookDir = /config/pacman/hooks
HookDir = /home/swytch/.config/pacman/hooks
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u

View File

@ -40,7 +40,7 @@ super + shift + {w,z}
$BROWSER
super + shift + p
$BROWSER --incognito
$BROWSER --private-window
super + shift + b
script="$(printf "bibinput\nbibshow" | dmenu -i -p "which script?")" && $script

View File

@ -39,9 +39,7 @@
This is the shell script I run just after I installed Arch. It does few things:
### What it does:
* Install the apps I use
* Download my personnal repos
* Compile my WM (`dwm`), my binary launcher (`dmenu`) and my terminal emulator (`st`), which are part of the [suckless](https://suckless.org/) project.
- Install the apps I use
- Download my personnal repos
- Compile my WM (`dwm`), my binary launcher (`dmenu`) and my terminal emulator (`st`), which are part of the [suckless](https://suckless.org/) project.

View File

@ -33,15 +33,13 @@ refinput(){
}
doctypes="article book online techreport"
base="$(basename "$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibinput] which bibliography?")")" # the -not -path allows find to ignore hidden files
file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibinput] which bibliography?")" # the -not -path allows find to ignore hidden files
[ -z "$base" ] && exit 1
file="$HOME/documents/bibliographies/"$base
[ -z "$file" ] && exit 1
refs="$(cat "$file" | grep "@" | sed "s/,$//g" | awk -F '{' '{print $2}' | tr '\n' ' ')"
# if the file does not exist, creates it
# if the file does not exist, create it
if [ ! -e "$file" ]; then
mkfile="$(printf "No\\nYes" | dmenu -i -p "$file does not exist. Create it?")"
[ "$mkfile" = "Yes" ] && (touch "$file")

View File

@ -4,7 +4,6 @@
# User inputs informations, this will show the content of an entry through dmenu
file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibshow] which bibliography?")" # the -not -path allows find to ignore hidden files
refs_list="$(cat "$file" | sed 's/\t//g' | tr '\n' ' ' | sed 's/}\ /}\n/g')"
@ -15,5 +14,5 @@ ref="$(echo "$refs_list" | dmenu -i -p 'infos?' -l 10)"
output="$(echo "$ref" | sed 's/author/\n author/g' | sed 's/",/",\n/g')"
echo "$output" | dmenu -i -p "infos" -l 20
echo "$output" | dmenu -i -p "infos" -l 10
echo "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | xclip -selection clipboard

View File

@ -10,9 +10,12 @@
file=$(readlink -f "$1")
dir=$(dirname "$file")
dirname=$(basename "$dir")
base="$(echo "${file%.*}" | awk -F '/' '{printf $NF}')"
shebang=$(sed -n 1p "$file")
sucklesstools="$(ls $XDG_CONFIG_HOME/suckless)"
cd "$dir" || exit
shebangtest()
@ -22,7 +25,7 @@ shebangtest()
esac
}
textype() { \
texcompile() { \
bibliography="$(cat "$file" | grep '\bibliography')"
if [ -n "$bibliography" ]; then
pdflatex --output-directory="$dir" "$base" &&
@ -33,16 +36,27 @@ textype() { \
pdflatex --output-directory="$dir" "$base" &&
pdflatex --output-directory="$dir" "$base"
fi
texclear "$file"
}
s_build(){
case "$file" in
*config.def.h) sudo make clean install && rm -f config.h ;;
*config.h) echo "" && echo "You should build from config.def.h !" ;;
esac
exit 0
}
for tool in $sucklesstools; do
if [ "$tool" = "$dirname" ]; then
s_build
fi
done
case "$file" in
*config.def.h) sudo make clean install && rm -f config.h ;;
*config.h) echo "" && echo "You should build from config.def.h !" ;;
*\.c*) make && ./main ;;
*\.h*) make && ./main ;;
*\.mom) refer -PS -e "$file" | pdfmom > "$base.pdf" ;;
*\.tex) textype "$base" ;;
*\.py) python "$file" ;;
*.c*|.h*) make && ./main ;;
*.mom) refer -PS -e "$file" | pdfmom > "$base.pdf" ;;
*.tex) texcompile "$base" ; texclear "$file" ;;
*.py) python "$file" ;;
*) shebangtest ;;
esac

View File

@ -7,7 +7,6 @@
# selection" which opens arandr.
twoscreen() { # If multi-monitor is selected and there are two screens.
mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
# Mirror displays using native resolution of external display and a scaled
# version for the internal display

View File

@ -3,9 +3,9 @@
## Wrapper for my dotfiles
git="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
cmd="$git status" ## by default, give the status
cmd="$git status" # by default, give the status
[ "$1" = "-g" ] && shift && cmd="$git $@" ## make the wrapper transparent
[ "$1" = "-g" ] && shift && cmd="$git $@" # make the wrapper transparent
[ "$1" = "-l" ] && shift && cmd="$git log"
[ "$1" = "-c" ] && shift && cmd="$git commit $@"

View File

@ -8,13 +8,10 @@
# Handle SIGTRAP signals sent by refbar to update the status bar immediately.
trap 'update' 5
# Set the deliminter character.
delim="|"
delim="|" # Set the delimiter character.
status() { \
# Gets the volume of ALSA's master volume output.
# Get the volume of ALSA's master volume output.
volume="$(pamixer --get-volume)"
muted="$(pamixer --get-mute)"
@ -38,7 +35,6 @@ status() { \
# Will show all batteries with approximate icon for remaining power.
# Or show that the computer is plugged to a power source
# In any case, show the remaining battery percentage
AC_ON="$(cat /sys/class/power_supply/AC/online)"
for x in /sys/class/power_supply/BAT?/capacity;
do
@ -57,7 +53,6 @@ status() { \
done && echo "$delim"
# Date and time.
date '+%b. %d - %I:%M%p'
}

View File

@ -2,7 +2,7 @@
## Control keyboard brightness
## level goes up at each call
## goes back to 0 after meeting maximum brightness
## goes back to 0 after reaching maximum brightness
## You need `upower` package to make it work

View File

@ -9,43 +9,37 @@ headers_list="$(ls | grep '.h$')"
sources_list="$(ls | grep '.cp*$')"
modules_list="$(echo "$sources_list" | sed 's/\.cp*//g' | tr '\n' ' ')"
targets_list="$(echo "$sources_list" | sed 's/\.cp*/\.o/g' | tr '\n' ' ')"
bool=false
comp=gcc
get_compiler(){
for source_ in "$sources_list"; do
case "$source_" in
*.cpp) comp="g++" && return;;
*.c) ;;
*.cpp) echo "g++" && return;;
*.c) echo "gcc";;
esac
done
}
is_c_project(){
if [ -n "$sources_list" ]; then
bool=true
fi
[ -n "$sources_list" ]
}
make_rule(){
if [ "$comp" = "gcc" ]; then
echo "$1.o : $1.c" >> makefile
echo "$1.o : $1.c $1.h" >> makefile
echo -e "\t\$(CC) -c $1.c \$(FLAGS)" >> makefile
else
echo "$1.o : $1.cpp" >> makefile
echo "$1.o : $1.cpp $1.h" >> makefile
echo -e "\t\$(CC) -c $1.cpp \$(FLAGS)" >> makefile
fi
echo "" >> makefile
}
is_c_project
if [ "$bool" = false ]; then
if ! is_c_project; then
echo "No C/C++ project in directory. Exiting..."
exit 1
fi
get_compiler
comp=get_compiler
touch makefile
@ -69,4 +63,9 @@ echo "clean :" >> makefile
echo -e "\trm \$(BIN) *.o vgcore.*" >> makefile
sed -i 's/\s$//' makefile
nvim makefile
if type "nvim" &> /dev/null; then
nvim makefile
else
vim makefile
fi

View File

@ -3,15 +3,13 @@
# /!\ files must be names 0_file0, 1_file1... in order to be processed correctly
# if the file already exists, delete it
if [ -e rendu.mom ]; then
rm rendu.mom
fi
[ -e rendu.mom ] && rm rendu.mom
pdf_list=$(ls *.mom)
list=$(ls *.mom)
touch rendu.mom
for doc in "$pdf_list"; do
for doc in "$list"; do
cat "$doc" >> rendu.mom
echo ".COLLATE" >> rendu.mom
done

View File

@ -10,6 +10,6 @@ case "$1" in
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|tns|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;;
*) printf "Give .tex file as argument.\\n" ;;
esac

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Create a LaTeX document with genereic metadata, then opens it with neovim (or vim as a fallback)
# Create a LaTeX document with genereic metadata, then open it with neovim (or vim as a fallback)
if [ -z "$1" ]; then
echo "Please provide a name for your file"

View File

@ -19,8 +19,7 @@ export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
export EDITOR="nvim"
export TERMINAL="st"
export READER="zathura"
export BROWSER="brave"
export INCOGNITO="brave --incognito"
export BROWSER="firefox"
## program settings
export LESS_TERMCAP_md="$(printf '%b' '\e[01;32m')"