summaryrefslogtreecommitdiffstats
path: root/.config/nvim/init.vim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/init.vim')
-rw-r--r--.config/nvim/init.vim60
1 files changed, 30 insertions, 30 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index b462bbd..2833984 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -1,19 +1,21 @@
-" _
-" __ _(_)_ __ ___ _ __ ___
-" \ \ / / | '_ ` _ \| '__/ __|
-" \ V /| | | | | | | | | (__
-" \_/ |_|_| |_| |_|_| \___|
+let mapleader =","
-let mapleader =" "
-
-call plug#begin('~/.vim/plugged')
+call plug#begin('~/.config/nvim/plugged')
+Plug 'tpope/vim-surround'
+Plug 'scrooloose/nerdtree'
Plug 'junegunn/goyo.vim'
Plug 'PotatoesMaster/i3-vim-syntax'
Plug 'jreybert/vimagit'
Plug 'LukeSmithxyz/vimling'
Plug 'vimwiki/vimwiki'
+Plug 'bling/vim-airline'
+Plug 'tpope/vim-commentary'
call plug#end()
+set bg=light
+set mouse=a
+set nohlsearch
+set clipboard=unnamedplus
" Some basics:
set nocompatible
filetype plugin on
@@ -26,7 +28,7 @@ call plug#end()
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Goyo plugin makes text more readable when writing prose:
- map <leader>f :Goyo \| set linebreak<CR>
+ 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>
@@ -34,6 +36,17 @@ call plug#end()
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
set splitbelow splitright
+" Nerd tree
+ map <C-n> :NERDTreeToggle<CR>
+ autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | 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>
+
" Shortcutting split navigation, saving a keypress:
map <C-h> <C-w>h
map <C-j> <C-w>j
@@ -51,7 +64,7 @@ call plug#end()
nnoremap S :%s//g<Left><Left>
" Compile document, be it groff/LaTeX/markdown/etc.
- map <leader>c :w! \| !compiler <c-r>%<CR><CR>
+ map <leader>c :w! \| !compiler <c-r>%<CR>
" Open corresponding .pdf/.html or preview
map <leader>p :!opout <c-r>%<CR><CR>
@@ -61,17 +74,11 @@ call plug#end()
" Ensure files are read as what I want:
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
+ let g:vimwiki_list = [{'path': '~/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
autocmd BufRead,BufNewFile *.tex set filetype=tex
-" Readmes autowrap text:
- autocmd BufRead,BufNewFile *.md set tw=79
-
-" Use urlscan to choose and open a url:
- :noremap <leader>u :w<Home> !urlscan -r 'linkhandler {}'<CR>
- :noremap ,, !urlscan -r 'linkhandler {}'<CR>
-
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
vnoremap <C-c> "+y
map <C-p> "+P
@@ -79,32 +86,25 @@ call plug#end()
" Enable Goyo by default for mutt writting
" Goyo's width will be the line limit in mutt.
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
- autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
+ autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo \| set bg=light
" Automatically deletes all trailing whitespace on save.
autocmd BufWritePre * %s/\s\+$//e
" When shortcut files are updated, renew bash and ranger configs with new material:
- autocmd BufWritePost ~/.bm* !shortcuts
+ autocmd BufWritePost ~/.bmdirs,~/.bmfiles !shortcuts
" Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
" Navigating with guides
- inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
- map <Space><Tab> <Esc>/<++><Enter>"_c4l
-
- "____ _ _
-"/ ___| _ __ (_)_ __ _ __ ___| |_ ___
-"\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __|
- "___) | | | | | |_) | |_) | __/ |_\__ \
-"|____/|_| |_|_| .__/| .__/ \___|\__|___/
- "|_| |_|
+ inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
+ vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
+ map <leader><leader> <Esc>/<++><Enter>"_c4l
"""LATEX
" Word count:
- autocmd FileType tex map <leader><leader>o :w !detex \| wc -w<CR>
+ autocmd FileType tex map <leader>w :w !detex \| wc -w<CR>
" Code snippets
autocmd FileType tex inoremap ,fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i
autocmd FileType tex inoremap ,fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA