-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvimrc.plugins
139 lines (116 loc) · 4.13 KB
/
vimrc.plugins
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
138
139
" plugins configure
" colorscheme gruvbox
" colorscheme badwolf
colorscheme molokai
let g:lightline = {'colorscheme': 'molokai'}
let g:NERDTreeDirArrows=0
let g:NERDTreeChDirMode=2
let g:NERDTreeRemoveFileCmd="mv -t /tmp/ "
let g:NERDTreeRemoveDirCmd="mv -t /tmp/ "
" let NERDTreeIgnore = ['\.pyc$']
noremap tt :NERDTreeToggle<CR>
noremap ff :NERDTreeFind<CR>
let NERDSpaceDelims = 1 " add space after comment delim for pep8
" For same reason vim registers <C-/> as <C-_>
noremap <C-_> :call NERDComment(0, "toggle")<cr>
noremap TT :TagbarToggle<CR>
let g:tagbar_autofocus = 1
let g:tagbar_autoclose = 1
let g:tagbar_foldlevel = 0
let g:yankring_history_dir='/tmp/'
let g:yankring_min_element_length=4
" no <C-P>
let g:yankring_replace_n_pkey = '<C-M>'
noremap <leader>y :YRShow<CR>
let g:ctrlp_map = '<C-P>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_tabpage_position = 'a'
let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --others --exclude-standard', 'find %s -type f']
" jedi-vim
" <leader>g: goto
" <leader>d: goto definitions
" <leader>r: rename
" <leader>n: usage
" K: doc
let g:jedi#auto_initialization = 1
let g:jedi#auto_vim_configuration = 1
" do not enable it by default, it will be very slow
let g:jedi#popup_on_dot = 0
" show doc on demand, default: K
let g:jedi#documentation_command = "<leader>k"
" where to show, left|right|top|bottom|winwidth
" let g:jedi#use_splits_not_buffers = "winwidth"
" open a module in vim
" :Pyimport os.path
" goto_definnitions first, fallback to goto_assignments for builtin
let g:jedi#goto_command = "<leader>g"
let g:jedi#goto_definitions_command = "<leader>d"
let g:jedi#goto_assignments_command = "<leader>a"
let g:jedi#rename_command = "<leader>r"
let g:jedi#usages_command = "<leader>n"
let g:jedi#completions_enabled = 0
" let g:jedi#completions_command = "<Tab>"
let g:jedi#popup_select_first = 1
" close autocomplete item docstring preview window while leaving insert mode
let g:jedi#auto_close_doc = 1
" show function call signatures in insert mode in real time, very helpful
let g:jedi#show_call_signatures = 1
" from foo<space> add import and trigger popup
let g:jedi#smart_auto_mappings = 1
" ale: Asynchronous Lint Engine
" let g:ale_fixers = {'python': ['black']}
" let g:ale_fix_on_save = 0
" https://github.com/dense-analysis/ale/tree/master/ale_linters/python
" for ansible_lint, add `# vi: ft=ansible.yaml` in file
let g:ale_linters = {
\ 'python': ['pylint'],
\ 'sh': ['shellcheck'],
\ 'make': ['checkmake'],
\ 'markdown': [],
\ 'dockerfile': ['hadolint'],
\ 'yaml': ['yamllint'],
\ 'ansible': ['ansible_lint'],
\}
" enable actionlint for github workflow yaml only
au BufRead,BufNewFile */.github/*/*.y{,a}ml let b:ale_linters = {'yaml': ['yamllint', 'actionlint']}
" let g:ale_linters_explicit = 0
" let g:ale_lint_on_enter = 1
" let g:ale_lint_on_text_changed = 'never'
" let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'python': ['black'],
\ 'css': ['prettier'],
\ 'json': ['prettier'],
\ 'yaml': ['prettier']
\}
let g:ale_completion_enabled = 1
let g:ale_sign_column_always = 1
" let g:airline#extensions#ale#enabled = 1
let g:ale_echo_msg_format = '[ALE][%severity%][%linter%] %s'
noremap <F10> :ALEGoToDefinition<CR>
noremap <F11> :ALEFindReferences<CR>
" SuperTab
let g:SuperTabDefaultCompletionType = "context"
" vim-gh-line
" let g:gh_trace = 1
let g:gh_line_map = '<leader>gh'
let g:gh_line_blame_map = '<leader>gb'
let g:gh_repo_map = '<leader>go'
" vim-terraform
" https://github.com/hashivim/vim-terraform/blob/master/doc/terraform.txt
let g:terraform_align = 0
let g:terraform_fmt_on_save = 0
" indentLine
" https://github.com/Yggdroot/indentLine
" toggle with :IndentLinesToggle
let g:indentLine_enabled = 1
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
" vim default 0: off, indentLine set it to 2, which will hide quotes in json file
let g:indentLine_conceallevel = 2
let g:indentLine_concealcursor = 'inc'
" enable indentLine, while still show quotes for json and markdown
let g:vim_json_conceal = 0
let g:markdown_syntax_conceal = 0