-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
executable file
·137 lines (119 loc) · 3.68 KB
/
.vimrc
File metadata and controls
executable file
·137 lines (119 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
"
" ~/.vimrc
"
" Vundle stuff
if empty(glob('~/.vim/bundle/Vundle.vim'))
silent !git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
autocmd VimEnter * :PluginInstall
endif
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'scrooloose/nerdtree'
Plugin 'dense-analysis/ale'
Plugin 'Glench/Vim-Jinja2-Syntax'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'lervag/vimtex'
Plugin 'akatch/vim-oceans'
Plugin 'sheerun/vim-polyglot'
Plugin 'vim-scripts/todo-txt.vim'
Plugin 'Einenlum/yaml-revealer'
" had to also `go get golang.org/x/tools/gopls`
call vundle#end()
filetype plugin indent on
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
if has("syntax")
syntax on
endif
colorscheme oceans
set background=dark
set laststatus=2
set shiftwidth=4
set tabstop=4
set backspace=indent,eol,start
set fileformats=unix
set nocompatible nohlsearch ttyfast expandtab autoindent number cursorline nocursorcolumn incsearch
" Insert cursor at previous position
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" State directories
for dir in [ 'backup', 'swap', 'undo' ]
if !isdirectory($HOME . '/.vim/' . dir)
call mkdir($HOME . '/.vim/' . dir, 'p')
endif
endfor
set backupdir^=~/.vim/backup/
set directory^=~/.vim/swap/
set undodir^=~/.vim/undo/
set backup writebackup undofile
" Keybinds
nmap <silent> <C-p> :tabprevious<cr>
nmap <silent> <C-n> :tabnext<cr>
nmap <silent> <C-t> :tabnew<cr>
nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-j> :wincmd j<CR>
nmap <silent> <C-k> :wincmd k<CR>
nmap <silent> <C-l> :wincmd l<CR>
nmap <silent> <leader>n :set number!<CR>
nmap <silent> <leader>p :set paste!<CR>
nmap <silent> <leader>t :NERDTreeToggle<CR>
nmap <silent> <leader>h :so $VIMRUNTIME/syntax/hitest.vim<CR>
nmap <silent> <A-j> :ALENextWrap<CR>
nmap <silent> <A-k> :ALEPreviousWrap<CR>
nmap <silent> <A-d> :ALEDetail<CR>
nmap <silent> <leader>d :r!date "+\%F"<CR>
nmap <silent> <leader>z :VimtexView<CR>
" pane separators like tmux
set fillchars+=vert:\│
" ctrlp
let g:ctrlp_map = '<s-f>'
let g:ctrlp_switch_buffer = 'Et'
" ale
let g:ale_fix_on_save = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_json_jq_options = '--indent 4'
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'elixir': ['mix_format'],
\ 'javascript': ['prettier'],
\ 'json': ['jq'],
\ 'terraform': ['terraform'],
\}
let g:ale_linters = {
\ 'go': ['gofmt', 'golint', 'go vet', 'gopls', 'golangci-lint'],
\ 'ansible': ['ansible-lint'],
\ 'elixir': ['elixir-ls'],
\ 'perl': ['perlcritic'],
\ 'terraform': ['terraform'],
\ 'ruby': ['rubocop'],
\ 'javascript': ['eslint'],
\ 'bicep': ['bicep'],
\}
"vim-go stuff
let g:go_highlight_array_whitespace_error = 1
let g:go_highlight_chan_whitespace_error = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_space_tab_error = 1
let g:go_highlight_trailing_whitespace_error = 1
let g:go_highlight_operators = 1
let g:go_highlight_functions = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_generate_tags = 1
let g:go_highlight_variable_declarations = 1
let g:go_highlight_variable_assignments = 1
let g:go_doc_url = "https://pkg.go.dev"
let g:ale_elixir_elixir_ls_release = expand("~/code/elixir-lsp/elixir-ls/rel")
" needs latexmk
let g:vimtex_view_method = 'zathura_simple'
" completion
set wildmode=longest,list,full
set wildmenu