-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
181 lines (156 loc) · 4.71 KB
/
Copy pathvimrc
File metadata and controls
181 lines (156 loc) · 4.71 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
execute pathogen#infect()
set rtp+=~/.fzf
let g:python_recommended_style = 0
filetype plugin indent on
syntax on
colorscheme elflord
set laststatus=2
set tabstop=2
set shiftwidth=2
set expandtab
set hlsearch
set incsearch
set wildmenu
set wildmode=longest,list
set undodir=$HOME/.vim/undo
set undofile
set showcmd
set clipboard=unnamedplus
set cc=80
set number
set relativenumber
set nofsync
if !isdirectory("/tmp/" . $USER)
call mkdir("/tmp/" . $USER, "p", 0700)
endif
set directory=/tmp/$USER//
set foldmethod=marker
" white and grey line numbers
highlight StatusLine cterm=None ctermbg=DarkGrey ctermfg=White
highlight LineNr ctermfg=DarkGrey
highlight CursorLineNr ctermfg=White
" jump to last position
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$")
\| exe "normal! g`\"" | endif
au BufRead,BufNewFile *.mod set syntax=ampl
endif
" split
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
" printf to/from fprintf
map <F2> If<Esc>wastderr, <Esc>
map <F3> 0wxwldwdw
" map tabs
let mapleader = "\<Space>"
noremap <leader>1 1gt
noremap <leader>2 2gt
noremap <leader>3 3gt
noremap <leader>4 4gt
noremap <leader>5 5gt
noremap <leader>6 6gt
noremap <leader>7 7gt
noremap <leader>8 8gt
noremap <leader>9 9gt
" run as python code
" noremap <leader>p :w !python<CR>
" open .cc/.hh
set wildcharm=<tab>
map <leader>c :vs <C-r>=expand('%:p')<CR><BS><BS>c<tab><CR>
map <leader>h :vs <C-r>=expand('%:p')<CR><BS><BS>h<tab><CR>
" open .log/.log.err
"map <leader>l :vs <C-r>=expand('%:p')<CR><BS><BS><BS><BS><CR>
"map <leader>e :vs <C-r>=expand('%:p')<CR>.err<CR>
" goto file with vertical split
nnoremap <C-w>f <C-w>f<C-w>L
" toggle line numbers
map <leader>n :set number!<CR>:set relativenumber!<CR>
" toggle wrap
map <leader>w :set wrap!<CR>
"""""""""""
" Plugins "
"""""""""""
" AutoComplPop
let g:acp_ignorecaseOption = 0
"let g:acp_behaviorPythonOmniLength = -1
let g:acp_enableAtStartup = 1
"" ale
""set omnifunc=ale#completion#OmniFunc
""set completeopt=menu,menuone,noinsert,noselect
""let g:ale_completion_enabled = 0
"set signcolumn=number
"nnoremap K :ALEHover<CR>
"nnoremap <leader>ai :ALEInfo<CR>
"nnoremap <leader>at :ALEToggle<CR>
"nnoremap <leader>ab :ALEToggleBuffer<CR>
"nnoremap <leader>gn :ALENext<CR>
"nnoremap <leader>gp :ALEPrevious<CR>
"nnoremap <leader>gd :ALEGoToDefinition<CR>
"nnoremap <leader>gt :ALEGoToTypeDefinition<CR>
"nnoremap <leader>gi :ALEGoToImplementation<CR>
"nnoremap <leader>gr :ALEFindReferences<CR>
"nnoremap <leader>gs :ALESymbolSearch<space>
"let g:ale_hover_cursor = 0
"
"let g:ale_linters = {
"\ "python": ["pyright"],
"\ "cpp": ["clangd"],
"\}
"
""let g:ale_fixers = {
""\ '*': ['remove_trailing_lines', 'trim_whitespace'],
""\}
" onedark
if (has("termguicolors"))
set termguicolors
endif
let g:onedark_color_overrides = {
\ "black": { "gui": "#000000", "cterm": "0", "cterm16": "0" },
\ "background": { "gui": "#000000", "cterm": "0", "cterm16": "NONE" },
\ "white": { "gui": "#D0D0D0", "cterm": "252", "cterm16": "15" },
\ "foreground": { "gui": "#D0D0D0", "cterm": "252", "cterm16": "NONE" },
\ "comment_grey": { "gui": "#6C6C6C", "cterm": "242", "cterm16": "7" },
\ "vertsplit": { "gui": "#6C6C6C", "cterm": "242", "cterm16": "7" },
\ "special_grey": { "gui": "#6C6C6C", "cterm": "242", "cterm16": "7" },
\ "gutter_fg_grey": { "gui": "#444444", "cterm": "238", "cterm16": "8" },
\ "visual_grey": { "gui": "#444444", "cterm": "238", "cterm16": "8" },
\ "menu_grey": { "gui": "#303030", "cterm": "236", "cterm16": "8" },
\ "cursor_grey": { "gui": "#303030", "cterm": "236", "cterm16": "8" },
\}
colorscheme onedark
highlight Title ctermfg=none
highlight TabLine guifg=#D0D0D0 guibg=#444444 ctermfg=252 ctermbg=238
highlight TabLineSel guifg=#303030 guibg=#D0D0D0 ctermfg=236 ctermbg=252
highlight TabLineFill guifg=#D0D0D0 guibg=#303030 ctermfg=252 ctermbg=236
highlight StatusLine guifg=#D0D0D0 guibg=#303030 ctermfg=252 ctermbg=236
highlight StatusLineNC guifg=#6C6C6C guibg=#121212 ctermfg=242 ctermbg=233
" undotree
nnoremap <leader>u :UndotreeToggle<CR>
" tagbar
nmap <F8> :TagbarToggle<CR>
" sneak
let g:sneak#label = 1
map f <Plug>Sneak_f
map F <Plug>Sneak_F
map t <Plug>Sneak_t
map T <Plug>Sneak_T
" fzf.vim
nnoremap <leader>p :Files<CR>
nnoremap <leader>- :Files <C-r>=expand('%:h')<CR><CR>
nnoremap <leader>l :Lines<CR>
nnoremap <leader>t :Tags<CR>
nnoremap <leader>r :Rg<space>
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }
let g:fzf_layout = { 'down': '~30%' }
" fzf-mru.vim
nnoremap <leader>m :FZFMru<CR>
" indentLine
let g:indentLine_char = '▏'
nnoremap <leader>i :IndentLinesToggle<CR>