dotfiles

andersuno dotfiles
git clone git://git.andersuno.nu/dotfiles.git
Log | Files | Refs | README

init.vim (3737B)


      1 set nocompatible
      2 
      3 
      4 call plug#begin()
      5 Plug 'vim-airline/vim-airline'
      6 Plug 'jreybert/vimagit'
      7 Plug 'airblade/vim-gitgutter'
      8 Plug 'tpope/vim-fugitive'
      9 Plug 'vim-syntastic/syntastic'
     10 Plug 'nvie/vim-flake8'
     11 "Plug 'Valloric/YouCompleteMe'
     12 Plug 'neoclide/coc.nvim', {'branch': 'release'}
     13 
     14 call plug#end()
     15 
     16 set number
     17 set smartcase
     18 set wildmenu
     19 set wildmode=list:longest,full
     20 set scrolloff=2
     21 "set cursorline
     22 "set ruler
     23 "set termguicolors
     24 colorscheme elflord
     25 :command-bang Q q
     26 :command-bang W w
     27 :command-bang WQ wq
     28 inoremap "" ""<Left>
     29 inoremap '' ''<Left>
     30 inoremap () ()<Left>
     31 inoremap [] []<Left>
     32 inoremap {} {}<Left>
     33 inoremap <> <><Left>
     34 
     35 " show whitespace
     36 set list
     37 
     38 " Enable folding
     39 set foldmethod=indent
     40 set foldlevel=99
     41 
     42 " Enable folding with the spacebar
     43 nnoremap <space> za
     44 
     45 " Python PEP 8
     46 "au BufNewFile,BufRead *.py
     47 au Filetype python setlocal
     48     \ tabstop=4
     49     \ softtabstop=4
     50     \ shiftwidth=4
     51     \ textwidth=79
     52     \ expandtab
     53     \ autoindent
     54     \ fileformat=unix
     55 
     56 " Yaml
     57 au Filetype yaml setlocal
     58     \ tabstop=2
     59     \ softtabstop=2
     60     \ shiftwidth=2
     61     \ textwidth=79
     62     \ expandtab
     63     \ autoindent
     64     \ fileformat=unix
     65 
     66 " Other filespecific settings
     67 au BufNewFile,BufRead *.js, *.html, *.css setlocal
     68     \ tabstop=2
     69     \ softtabstop=2
     70     \ shiftwidth=2
     71 
     72 " Mark bad whitespace
     73 highlight ExtraWhitespace ctermbg=red guibg=red
     74 " Trailing whitespace
     75 au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match ExtraWhitespace /\s\+$/
     76 " Show tabs that are not at the start of a line:
     77 match ExtraWhitespace /[^\t]\zs\t\+/
     78 
     79 " Ycm
     80 "let g:ycm_add_preview_to_completeopt = 0
     81 "let g:ycm_autoclose_preview_window_after_completion = 1
     82 "let g:ycm_autoclose_preview_window_after_insertion = 1
     83 "let g:ycm_global_ycm_extra_conf = "~/.config/nvim/plugged/YouCompleteMe/third_party/ycmd/.ycm_extra_conf.py"
     84 
     85 
     86 " Coc nvim
     87 
     88 " if hidden is not set, TextEdit might fail.
     89 set hidden
     90 
     91 " Some servers have issues with backup files, see #649
     92 set nobackup
     93 set nowritebackup
     94 
     95 " Better display for messages
     96 set cmdheight=2
     97 
     98 " You will have bad experience for diagnostic messages when it's default 4000.
     99 set updatetime=300
    100 
    101 " don't give |ins-completion-menu| messages.
    102 set shortmess+=c
    103 
    104 " always show signcolumns
    105 set signcolumn=yes
    106 
    107 
    108 " Use tab for trigger completion with characters ahead and navigate.
    109 " Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
    110 inoremap <silent><expr> <TAB>
    111       \ pumvisible() ? "\<C-n>" :
    112       \ <SID>check_back_space() ? "\<TAB>" :
    113       \ coc#refresh()
    114 inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
    115 
    116 function! s:check_back_space() abort
    117   let col = col('.') - 1
    118   return !col || getline('.')[col - 1]  =~# '\s'
    119 endfunction
    120 
    121 
    122 " Airline
    123 
    124 let g:airline_powerline_fonts = 1
    125 
    126 if !exists('g:airline_symbols')
    127         let g:airline_symbols = {}
    128 endif
    129 
    130 " unicode symbols
    131 "        let g:airline_left_sep = '»'
    132 "        let g:airline_left_sep = '▶'
    133 "        let g:airline_right_sep = '«'
    134 "        let g:airline_right_sep = '◀'
    135 "        let g:airline_symbols.linenr = '␊'
    136 "        let g:airline_symbols.linenr = '␤'
    137 "        let g:airline_symbols.linenr = '¶'
    138 "        let g:airline_symbols.branch = '⎇'
    139 "        let g:airline_symbols.paste = 'ρ'
    140 "        let g:airline_symbols.paste = 'Þ'
    141 "        let g:airline_symbols.paste = '∥'
    142 "        let g:airline_symbols.notexists = 'Ɇ'
    143 "        let g:airline_symbols.whitespace = 'Ξ'
    144 "
    145 "" airline symbols
    146 "        let g:airline_left_sep = ''
    147 "        let g:airline_left_alt_sep = ''
    148 "        let g:airline_right_sep = ''
    149 "        let g:airline_right_alt_sep = ''
    150 "        let g:airline_symbols.branch = ''
    151         let g:airline_symbols.readonly = '🔒🔒🔒🔒🔒'
    152 "        let g:airline_symbols.linenr = ''
    153