vim: pimp keybind usability (remove some, adjust fzf)

This commit is contained in:
Marco Thomas
2023-08-29 12:17:02 +02:00
parent c8d3d8bc0e
commit f99d0e47ef
2 changed files with 33 additions and 33 deletions

View File

@@ -1,4 +1,6 @@
# fzf # fzf
export FZF_DEFAULT_COMMAND='find .'
export FZF_DEFAULT_OPTS=' export FZF_DEFAULT_OPTS='
--layout=reverse --layout=reverse
--color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101 --color=fg:#5c6a72,bg:#FDF6E3,hl:#8da101
@@ -81,25 +83,25 @@ ocr() {
} }
# deprecated # deprecated
# conservation() { conservation() {
# location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode' location='/sys/bus/platform/drivers/ideapad_acpi/VPC2004:00/conservation_mode'
# if [ -z $1 ]; then if [ -z $1 ]; then
# cat $location cat $location
# elif [ $1 = '0' ] || [ $1 = '1' ]; then elif [ $1 = '0' ] || [ $1 = '1' ]; then
# echo $1 | sudo tee $location echo $1 | sudo tee $location
# else else
# echo 'Invalid option' echo 'Invalid option'
# fi fi
# } }
#
# power() { power() {
# location='/sys/firmware/acpi/platform_profile' location='/sys/firmware/acpi/platform_profile'
# if [ -z $1 ]; then if [ -z $1 ]; then
# echo "Current:" $(cat $location) echo "Current:" $(cat $location)
# echo "Can be one of:" $(cat /sys/firmware/acpi/platform_profile_choices) echo "Can be one of:" $(cat /sys/firmware/acpi/platform_profile_choices)
# elif [ $1 = 'low-power' ] || [ $1 = 'balanced' ] || [ $1 = 'performance' ]; then elif [ $1 = 'low-power' ] || [ $1 = 'balanced' ] || [ $1 = 'performance' ]; then
# echo $1 | sudo tee $location echo $1 | sudo tee $location
# else else
# echo 'Invalid option' echo 'Invalid option'
# fi fi
# } }

View File

@@ -128,23 +128,28 @@ let &t_EI = "\<Esc>[2 q"
" ============================== netrw " ============================== netrw
let g:netrw_winsize = 25 " width let g:netrw_winsize = 25 " width
let g:netrw_liststyle = 3 " Tree-like structure let g:netrw_liststyle = 3 " Tree-like structure
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
" ============================== Macros and Mappings " ============================== Macros and Mappings
" im a lazy brick " im a lazy brick
cabbrev g Git cabbrev g Git
cabbrev mktex latexmk -xelatex -shell-escape cabbrev mktex latexmk -xelatex -shell-escape
cabbrev vs vsplit
" search git tracked files via git-ls-files(1) " search files via fzf
map <C-p> :GFiles<CR> map <C-p> :Files!<CR>
" search in git tracked files with git-grep(1) " search in git tracked files with git-grep(1)
command! -bang -nargs=* GGrep command! -bang -nargs=* GGrep
\ call fzf#vim#grep( \ call fzf#vim#grep(
\ 'git grep --line-number -- '.shellescape(<q-args>), 0, \ 'git grep --line-number -- '.shellescape(<q-args>), 0,
\ fzf#vim#with_preview(), <bang>0) \ fzf#vim#with_preview(), <bang>0)
if has("linux")
map <C-f> :GGrep!<CR>
else
" for some reason, openbsd doesnt like fzf live commands
map <C-f> :GGrep map <C-f> :GGrep
endif
" kill whitespaces fast and efficient " kill whitespaces fast and efficient
fun! TrimWhitespace() fun! TrimWhitespace()
@@ -154,19 +159,12 @@ fun! TrimWhitespace()
endfun endfun
noremap <leader>ws :call TrimWhitespace()<CR> noremap <leader>ws :call TrimWhitespace()<CR>
" sometimes lsp discards message too quickly
map <C-M> :messages<CR>
" comment DWIM " comment DWIM
map <C-_> :Commentary<CR> map <C-_> :Commentary<CR>
" clear search highlighting faster " clear search highlighting faster
map <Esc><Esc> :noh <CR> map <Esc><Esc> :noh <CR>
" Codi
cabbrev py CodiNew python
map <C-i> :Codi!!<CR>
" ============================== LSP " ============================== LSP
set hidden set hidden
let g:LanguageClient_serverCommands = { let g:LanguageClient_serverCommands = {