dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

init.vim (1944B)


      1 let mapleader ="\\"
      2 
      3 if ! filereadable(expand('~/.config/nvim/autoload/plug.vim'))
      4 	echo "Downloading junegunn/vim-plug to manage plugins..."
      5 	silent !mkdir -p ~/.config/nvim/autoload/
      6 	silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim
      7 	autocmd VimEnter * PlugInstall
      8 endif
      9 
     10 set number relativenumber
     11 set nohlsearch
     12 syntax on
     13 set nocompatible
     14 set clipboard=unnamedplus
     15 filetype plugin indent on
     16 
     17 call plug#begin('~/.config/nvim/plugged')
     18 Plug 'mcchrish/nnn.vim'
     19 Plug 'scrooloose/nerdtree'
     20 Plug 'scrooloose/nerdcommenter'
     21 Plug 'itchyny/lightline.vim'
     22 Plug 'lervag/vimtex'
     23 Plug 'AndrewRadev/id3.vim'
     24 Plug 'vimwiki/vimwiki'
     25 Plug 'tpope/vim-surround'
     26 Plug 'tpope/vim-fugitive'
     27 Plug 'junegunn/goyo.vim'
     28 Plug 'jreybert/vimagit'
     29 Plug 'vim-syntastic/syntastic'
     30 call plug#end()
     31 
     32 
     33 vnoremap <silent><Leader>y "yy <Bar> :call system('xclip', @y)<CR>
     34 
     35 " vimwiki related
     36 let g:vimwiki_list = [{'path': '~/.wiki'}, {'path': '~/.wiki2'}]
     37 autocmd FileType vimwiki nnoremap <leader>vws :VWS 
     38 autocmd FileType vimwiki nnoremap <leader>nn :lnext<CR>
     39 autocmd FileType vimwiki nnoremap <leader>NN :lprevious<CR>
     40 
     41 " Goyo keybinding
     42 map <leader>nd :Goyo <CR>
     43 map <leader>yd :Goyo! <CR>
     44 
     45 " Get bibliography
     46 map <leader>b :vsp<space>$BIB<CR>
     47 
     48 " Set bg
     49 map <leader>bgd :set bg=dark<CR>
     50 map <leader>bgl :set bg=light<CR>
     51 
     52 " Placeholders
     53 
     54 " Create place holder
     55 map <leader>aa a<-.-><Esc>
     56 " Go to the next placeholder
     57 vnoremap <leader>ph <Esc>/<-.-><Enter>"_c5l
     58 map <leader>ph <Esc>/<-.-><Enter>"_c5l
     59 
     60 " NerdTree
     61 map <C-o> :NERDTreeToggle<CR>
     62 
     63 " Syntastic
     64 map <leader>syn :SyntasticToggleMode<CR>
     65 " Syntastic tex
     66 let g:syntastic_tex_chktex_post_args = "-n 8 -n 24"
     67 " Syntastic shell
     68 let g:syntastic_sh_checkers = ["shellcheck", "checkbashisms", "sh"]
     69 let g:syntastic_sh_shellcheck_post_args = "-e SC2145 -e SC2015 -e SC2162 -e SC1090"
     70 
     71 " Clear tex build files after exit
     72 autocmd VimLeave *.tex !texclear %