summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-11-19 09:21:04 -0500
committerLuke Smith <luke@lukesmith.xyz>2020-11-19 09:21:04 -0500
commitae2f08ec697643f9a6978e6c59d0173e88497211 (patch)
treeb2f4bd9e8de4df50810222a473e563957f0353f1 /.config/nvim
parent8983f6aeb4bc343ed61f3981334c30f434a42626 (diff)
downloadeibhear-ae2f08ec697643f9a6978e6c59d0173e88497211.tar.gz
eibhear-ae2f08ec697643f9a6978e6c59d0173e88497211.tar.zst
eibhear-ae2f08ec697643f9a6978e6c59d0173e88497211.zip
minor updates
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/init.vim48
1 files changed, 37 insertions, 11 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 8deb34a..bf982c1 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -19,11 +19,16 @@ Plug 'tpope/vim-commentary'
Plug 'ap/vim-css-color'
call plug#end()
+set title
set bg=light
set go=a
set mouse=a
set nohlsearch
set clipboard+=unnamedplus
+set noshowmode
+set noruler
+set laststatus=0
+set noshowcmd
" Some basics:
nnoremap c "_c
@@ -36,13 +41,12 @@ set clipboard+=unnamedplus
set wildmode=longest,list,full
" Disables automatic commenting on newline:
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
-
+" Perform dot commands over visual blocks:
+ vnoremap . :normal .<CR>
" Goyo plugin makes text more readable when writing prose:
map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
-
" Spell-check set to <leader>o, 'o' for 'orthography':
map <leader>o :setlocal spell! spelllang=en_us<CR>
-
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
@@ -56,11 +60,11 @@ set clipboard+=unnamedplus
endif
" vimling:
- nm <leader>d :call ToggleDeadKeys()<CR>
- imap <leader>d <esc>:call ToggleDeadKeys()<CR>a
- nm <leader>i :call ToggleIPA()<CR>
- imap <leader>i <esc>:call ToggleIPA()<CR>a
- nm <leader>q :call ToggleProse()<CR>
+ nm <leader><leader>d :call ToggleDeadKeys()<CR>
+ imap <leader><leader>d <esc>:call ToggleDeadKeys()<CR>a
+ nm <leader><leader>i :call ToggleIPA()<CR>
+ imap <leader><leader>i <esc>:call ToggleIPA()<CR>a
+ nm <leader><leader>q :call ToggleProse()<CR>
" Shortcutting split navigation, saving a keypress:
map <C-h> <C-w>h
@@ -72,7 +76,7 @@ set clipboard+=unnamedplus
map Q gq
" Check file in shellcheck:
- map <leader>s :!clear && shellcheck %<CR>
+ map <leader>s :!clear && shellcheck -x %<CR>
" Open my bibliography file in split
map <leader>b :vsp<space>$BIB<CR>
@@ -109,14 +113,36 @@ set clipboard+=unnamedplus
" Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e
- autocmd BufWritepre * %s/\n\+\%$//e
+ autocmd BufWritePre * %s/\n\+\%$//e
" When shortcut files are updated, renew bash and ranger configs with new material:
autocmd BufWritePost bm-files,bm-dirs !shortcuts
" Run xrdb whenever Xdefaults or Xresources are updated.
- autocmd BufWritePost *Xresources,*Xdefaults,*xresources,*xdefaults !xrdb %
+ autocmd BufRead,BufNewFile xresources,xdefaults set filetype=xdefaults
+ autocmd BufWritePost Xresources,Xdefaults,xresources,xdefaults !xrdb %
+" Recompile dwmblocks on config edit.
+ autocmd BufWritePost ~/.local/src/dwmblocks/config.h !cd ~/.local/src/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks }
" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable.
if &diff
highlight! link DiffText MatchParen
endif
+
+" Function for toggling the bottom statusbar:
+let s:hidden_all = 1
+function! ToggleHiddenAll()
+ if s:hidden_all == 0
+ let s:hidden_all = 1
+ set noshowmode
+ set noruler
+ set laststatus=0
+ set noshowcmd
+ else
+ let s:hidden_all = 0
+ set showmode
+ set ruler
+ set laststatus=2
+ set showcmd
+ endif
+endfunction
+nnoremap <leader>h :call ToggleHiddenAll()<CR>