dotfiles/.vimrc

138 lines
3.4 KiB
VimL
Raw Normal View History

2018-07-21 17:30:18 +02:00
set nocompatible " be iMproved, required
2018-12-05 08:21:18 +01:00
filetype on " required
2018-07-21 17:30:18 +02:00
2020-06-28 22:44:03 +02:00
"set rtp+=~/.vim/bundle/Vundle.vim
"call vundle#begin()
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/syntastic'
Plug 'rust-lang/rust.vim'
Plug 'fatih/vim-go'
Plug 'udalov/kotlin-vim'
"Plug 'Valloric/YouCompleteMe'
Plug 'phanviet/vim-monokai-pro'
Plug 'cespare/vim-toml'
Plug 'sirver/UltiSnips'
Plug 'honza/vim-snippets'
Plug 'lotabout/skim', { 'dir': '~/.skim', 'do': './install' }
Plug 'lotabout/skim.vim'
Plug 'ervandew/supertab'
2019-08-03 07:46:42 +02:00
" rp call thing for auto completion with language servers
2020-06-28 22:44:03 +02:00
Plug 'roxma/nvim-yarp'
2019-08-03 07:46:42 +02:00
" language client stuff
2020-06-28 22:44:03 +02:00
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-ultisnips'
Plug 'ncm2/ncm2-racer'
"Plug 'zxqfl/tabnine-vim'
2018-07-21 17:30:18 +02:00
2019-12-10 18:50:44 +01:00
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
2020-06-28 22:44:03 +02:00
"call vundle#end() " required
call plug#end()
2018-12-26 15:39:12 +01:00
"set rtp+=~/code/tabnine-vim
filetype plugin on
autocmd BufNewFile,BufRead *.vpy setfiletype python
2019-12-10 18:50:44 +01:00
autocmd BufNewFile,BufRead *.kt set ft=kotlin
2018-07-21 17:30:18 +02:00
2019-08-03 07:46:42 +02:00
" for ncm2 completion
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect
2020-06-28 22:44:03 +02:00
" When the <Enter> key is pressed while the popup menu is visible, it only
" hides the menu. Use this mapping to close the menu and also start a new line.
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
2019-08-03 07:46:42 +02:00
" Required for operations modifying multiple buffers like rename.
set hidden
2020-06-02 11:04:40 +02:00
"\ 'rust': ['rustup', 'run', 'stable', 'rls'],
2020-06-28 22:44:03 +02:00
"\ 'rust': ['rustup', 'run', 'nightly', 'rls'],
2019-08-03 07:46:42 +02:00
let g:LanguageClient_serverCommands = {
2020-06-28 22:44:03 +02:00
\ 'rust': ['rust-analyzer'],
2019-12-10 18:50:44 +01:00
\ 'haskell': ['hie-wrapper'],
\ 'python': ['/usr/bin/pyls'],
\ 'go': ['gopls'],
\ 'kotlin': ['/usr/bin/kotlin-language-server'],
\ 'c': ['/usr/bin/ccls'],
2020-06-28 22:44:03 +02:00
\ 'java': ['jdtls'],
2019-08-03 07:46:42 +02:00
\ }
nnoremap <F5> :call LanguageClient_contextMenu()<CR>
" Or map each action separately
nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
2019-12-10 18:50:44 +01:00
nnoremap <silent> <F6> :call LanguageClient#textDocument_rename()<CR>
2018-07-21 17:30:18 +02:00
2018-02-07 13:19:36 +01:00
set number
set showmatch
set hlsearch
set ignorecase
set smartcase
set incsearch
set autoindent
set cindent
set expandtab
set shiftwidth=4
set smartindent
set smarttab
set softtabstop=4
2018-12-05 08:21:18 +01:00
set relativenumber
2018-02-07 13:19:36 +01:00
" set beam cursor in insert mode
let &t_SI = "\<esc>[5 q"
let &t_SR = "\<esc>[5 q"
let &t_EI = "\<esc>[2 q"
set undolevels=1000
set backspace=indent,eol,start
2018-07-21 17:30:18 +02:00
set background=dark
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
2019-08-03 07:46:42 +02:00
let g:autofmt_autosave = 1
set termguicolors
2020-06-02 11:04:40 +02:00
colorscheme monokai_pro
2018-02-07 13:19:36 +01:00
syntax on
2019-12-10 18:50:44 +01:00
let g:netrw_liststyle = 3
let g:netrw_banner = 0
let g:netrw_browse_split = 4
2020-06-02 11:04:40 +02:00
let g:netrw_winsize = 15
2019-12-10 18:50:44 +01:00
nmap <F2> :Vexplore<Return>
2020-06-02 11:04:40 +02:00
nmap <C-A-L> :RustFmt<Return>
2019-12-10 18:50:44 +01:00
2018-02-07 13:19:36 +01:00
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
2019-12-10 18:50:44 +01:00
let g:syntastic_always_populate_loc_list = 0
2018-02-07 13:19:36 +01:00
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
2018-02-07 13:19:36 +01:00
let g:syntastic_check_on_wq = 0
let g:syntastic_check_on_write = 0
let g:syntastic_mode_map = { 'mode': 'passive' }
2019-12-10 18:50:44 +01:00
nmap <F3> :SyntasticCheck<CR>
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
"nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
set splitbelow
set splitright
2020-06-28 22:44:03 +02:00
nmap <S-Tab> :Snippets<CR>
nmap <C-G> :Files<CR>
imap <C-G> <Esc>:Files<CR>
nmap <S-L> :BLines<CR>
nmap <C-F> :Lines<CR>