dotfiles/vimrc

190 lines
4.1 KiB
VimL
Raw Permalink Normal View History

2019-07-22 16:03:35 +00:00
call plug#begin('~/.local/share/nvim/plugged')
2020-12-06 22:32:18 +00:00
" general dev tools
2019-07-22 16:03:35 +00:00
Plug 'w0rp/ale'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
2020-12-06 22:32:18 +00:00
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'LnL7/vim-nix'
2019-07-22 16:03:35 +00:00
2020-12-06 22:32:18 +00:00
" go tools
2019-07-22 16:03:35 +00:00
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
2020-12-06 22:32:18 +00:00
" rust tools
2019-07-22 16:03:35 +00:00
Plug 'rust-lang/rust.vim'
2020-12-06 22:32:18 +00:00
" Plug 'racer-rust/vim-racer'
2019-07-22 16:03:35 +00:00
2020-12-06 22:32:18 +00:00
" reason/bucklescript
Plug 'reasonml-editor/vim-reason-plus'
" git
2019-07-22 16:03:35 +00:00
Plug 'mhinz/vim-signify'
Plug 'tpope/vim-fugitive'
2020-12-06 22:32:18 +00:00
" beautify
Plug 'morhetz/gruvbox'
2019-07-22 16:03:35 +00:00
Plug 'vim-airline/vim-airline'
2020-12-06 22:32:18 +00:00
Plug 'liuchengxu/space-vim-theme'
2019-07-22 16:03:35 +00:00
2020-12-06 22:32:18 +00:00
" python tools
" Plug 'deoplete-plugins/deoplete-jedi'
" Plug 'davidhalter/jedi-vim'
" Plug 'hdima/python-syntax'
Plug 'vim-python/python-syntax'
2019-07-22 16:03:35 +00:00
2020-12-06 22:32:18 +00:00
" elm tools
Plug 'andys8/vim-elm-syntax'
" Javascript
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
" lisps
Plug 'wlangstroth/vim-racket'
Plug 'junegunn/rainbow_parentheses.vim'
" notes and organization
Plug 'vimwiki/vimwiki'
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
2014-04-12 20:01:03 +00:00
set nocompatible
set encoding=utf-8
set shortmess+=c
2014-04-12 20:01:03 +00:00
set showcmd
set noshowmode
set completeopt-=preview
set completeopt+=noinsert
set completeopt+=noselect
if has("termguicolors")
set termguicolors
endif
2014-04-12 20:01:03 +00:00
set background=dark
2020-12-06 22:32:18 +00:00
" colorscheme gruvbox
colorscheme space_vim_theme
2014-04-12 20:01:03 +00:00
"always show status bar
set laststatus=2
set number
syntax enable
filetype plugin on
filetype plugin indent on
"indent and tab
set nowrap
set expandtab
set backspace=indent,eol,start
2020-12-06 22:32:18 +00:00
set tabstop=4 shiftwidth=4 softtabstop=4
autocmd FileType javascript setlocal shiftwidth=2 softtabstop=2
"turn paste mode on and off with F3
set pastetoggle=<F3>
"search
set hlsearch
set incsearch
set ignorecase
set smartcase
"wildmenu config
set wildmenu
set wildmode=longest:full,full
"Better split navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
" choose the fastest available searcher
if executable('rg')
let g:ctrlp_user_command = 'rg --files %s'
set grepprg=rg\ --no-heading\ --vimgrep\ --smart-case
endif
" vim-signify
let g:signify_vcs_list = [ 'git', 'hg' ]
let g:signify_sign_change = "~"
2020-12-06 22:32:18 +00:00
" clojureee
au FileType clojure RainbowParentheses
2017-01-04 19:58:06 +00:00
"Go specific settings
au BufRead,BufNewFile *.go set list noexpandtab syntax=go listchars=tab:\|\ ,trail:-
2020-12-06 22:32:18 +00:00
" YAML
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
function! CleverTab()
2017-01-04 19:58:06 +00:00
if pumvisible()
2020-12-06 22:32:18 +00:00
return "\<C-N>"
2017-01-04 19:58:06 +00:00
endif
2020-12-06 22:32:18 +00:00
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
elseif exists('&omnifunc') && &omnifunc != ''
return "\<C-X>\<C-O>"
2017-01-04 19:58:06 +00:00
else
2020-12-06 22:32:18 +00:00
return "\<C-N>"
2017-01-04 19:58:06 +00:00
endif
endfunction
2020-12-06 22:32:18 +00:00
inoremap <Tab> <C-R>=CleverTab()<CR>
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
let g:ale_fixers = {
\ 'javascript': ['prettier', 'eslint'],
\ 'python': ['black'],
\ }
let g:LanguageClient_serverCommands = {
\ 'rust': ['rust-analyzer'],
\ 'python': ['/usr/local/bin/pyls'],
\ 'reason': ['/home/mike/bin/reason-language-server'],
\ 'javascript': ['/usr/bin/javascript-typescript-stdio'],
\ }
let g:python_highlight_all = 1
2017-01-04 19:58:06 +00:00
let g:go_fmt_command = "goimports"
2020-12-06 22:32:18 +00:00
let g:go_doc_popup_window = 1
2017-01-04 19:58:06 +00:00
let g:go_highlight_functions = 1
let g:go_highlight_function_calls = 1
2017-01-04 19:58:06 +00:00
let g:go_highlight_methods = 1
let g:go_highlight_types = 1
2017-01-04 19:58:06 +00:00
let g:go_highlight_fields = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
"let g:go_highlight_variable_declarations = 1
"let g:go_highlight_variable_assignments = 1
2016-03-10 16:18:32 +00:00
" vim-jedi settings
" disable vim-jedi autocomplete as we get it with deoplete-jedi
" but we want all the other functionality
let g:jedi#completions_enabled = 0
2020-12-06 22:32:18 +00:00
" let g:jedi#use_splits_not_buffers = 'winwidth'
2014-04-12 20:01:03 +00:00
" deoplete configuration
let g:deoplete#enable_at_startup = 1
2014-04-12 20:01:03 +00:00
if filereadable(expand("~/.vim/local.vim"))
source ~/.vim/local.vim
endif