From 159e748613ab407f9aba88e6295053c827447c5f Mon Sep 17 00:00:00 2001 From: speedie Date: Thu, 18 Jan 2024 18:07:07 +0100 Subject: [PATCH] speedie-nvim | Add new config --- .config/nvim/config | 48 ++++++++++++++++++++++++++++++++++++++++++--- commit.sh | 2 +- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/.config/nvim/config b/.config/nvim/config index a4a356f..11f99a2 100644 --- a/.config/nvim/config +++ b/.config/nvim/config @@ -1,3 +1,6 @@ +" speedie's neovim configuration +" purely for productivity, no bloat + syntax on set rnu @@ -10,23 +13,54 @@ set autoindent set expandtab set noswapfile set nocursorline +set laststatus=0 set undolevels=10000 set softtabstop=4 set shiftwidth=4 set tabstop=4 +set spelllang=en_us +set spellsuggest=best,5 +set foldmethod=indent +set laststatus=0 set termguicolors set t_Co=256 set t_ut= set background=dark +colorscheme elflord + +fu! SaveSession() + execute 'mksession! ' . getcwd() . '/.session.nvim' +endfunction + +fu! RestoreSession() + if argc() == 0 + if filereadable(getcwd() . '/.session.nvim') + execute 'so ' . getcwd() . '/.session.nvim' + if bufexists(1) + for l in range(1, bufnr('$')) + if zufwinnr(l) == -1 + exec 'sbuffer ' . l + endif + endfor + endif + + silent execute '!rm -f ' . getcwd() . '/.session.nvim' + endif + endif +endfunction autocmd BufReadPre *.md set spell autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\t/ /e +autocmd BufWritePre Makefile %s/ /\t/e +autocmd VimLeave * call SaveSession() +autocmd VimEnter * nested call RestoreSession() -highlight Normal ctermfg=grey ctermbg=lightgray -hi SpellBad guisp=red gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl -hi SpellCap guisp=yellow gui=undercurl guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE term=underline cterm=undercurl +highlight Normal ctermfg=grey ctermbg=lightgray guifg=#ffffff guibg=#222222 +highlight Folded ctermfg=grey ctermbg=lightgray guifg=#afeeee guibg=#333333 +highlight SpellBad guisp=red gui=undercurl guifg=none guibg=none ctermfg=none ctermbg=none term=underline cterm=undercurl +highlight SpellCap guisp=yellow gui=undercurl guifg=none guibg=none ctermfg=none ctermbg=none term=underline cterm=undercurl filetype plugin indent on @@ -39,6 +73,14 @@ nnoremap :vsplit nnoremap :only nnoremap :term +nnoremap :set spell! +nnoremap :set spelllang=en_us +nnoremap :set spelllang=sv_se +nnoremap :silent execute '!setxkbmap us' +nnoremap :silent execute '!setxkbmap se' +nnoremap [s1z= +nnoremap 1z= + nnoremap H :vertical resize -10 nnoremap J :resize -10 nnoremap K :resize +10 diff --git a/commit.sh b/commit.sh index 4ea8114..a8aa323 100755 --- a/commit.sh +++ b/commit.sh @@ -4,7 +4,7 @@ if [ -e "$HOME/.config/nvim" ]; then rm -rf .config/nvim mkdir -p .config cp -r $HOME/.config/nvim .config/ - rm -rf .config/nvim/vimdata + rm -rf .config/nvim/vimdata .config/nvim/.session.nvim git add .config/* commit.sh install.sh git commit -a -m "speedie-nvim | Add new config"