speedie-nvim | Add new config

This commit is contained in:
Jacob 2024-01-18 18:07:07 +01:00
parent cd92310b79
commit 159e748613
2 changed files with 46 additions and 4 deletions

View file

@ -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 <C-w> :vsplit<cr>
nnoremap <C-q> :only<cr>
nnoremap <C-t> :term<cr>
nnoremap <F2> :set spell!<cr>
nnoremap <F3> :set spelllang=en_us<cr>
nnoremap <F4> :set spelllang=sv_se<cr>
nnoremap <F7> :silent execute '!setxkbmap us'<cr>
nnoremap <F8> :silent execute '!setxkbmap se'<cr>
nnoremap <C-e> [s1z=
nnoremap <C-r> 1z=
nnoremap H :vertical resize -10<cr>
nnoremap J :resize -10<cr>
nnoremap K :resize +10<cr>

View file

@ -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"