-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
176 lines (124 loc) · 6.41 KB
/
.ideavimrc
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
" source ~/.config/.ideavimrc
nnoremap <SPACE> <Nop>
let mapleader=" "
set nocompatible " Disable vi-compatibility
set t_Co=256
syntax on
set foldlevelstart=1
" set easymotion
set which-key
set notimeout
set hidden " for coc, also something for buffers
syntax enable
filetype off
filetype plugin indent on
set ttyfast " helps in fast scrolling of screen
set list " show trailing white space
" set relativenumber
set showmode " always show what mode we're currently editing in
set nowrap " don't wrap lines
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set number " always show line numbers
set smartcase " turn on case sensitive, if any capital letter enterred.
set incsearch " search as characters are entered
set hlsearch " highlight matches
set visualbell " don't beep
set noerrorbells " don't beep
set signcolumn=yes
set pumheight=10 " Completion window max size
set maxmempattern=20000 " increase max memory to show syntax highlighting for large files
set viminfo='1000 " recently opened files, :FzfHistory uses it
set scrolloff=8 " show context above/below cursorline
set shiftwidth=2 " normal mode indentation commands use 2 spaces
"""" Basic Behavior
set encoding=utf-8 " set encoding to UTF-8 (default was "latin1") " also for coc
set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc
set wildmenu " enhanced command line completion
set wildmode=longest,list,full " completes files like a shell
autocmd VimResized * :wincmd = " automatically rebalance windows on vim resize
set lazyredraw " redraw screen only when we need to, help in fast scrolling of screen
set showmatch " highlight matching parentheses / brackets [{()}]
""""" status line
set laststatus=2 " enable the status line, if enabled then we can do futher tweaking by set statusline
" for futher tweaking refer to https://shapeshed.com/vim-statuslines/
" set laststatus=0 " to disable the status line
set showtabline=2 " Always show tabs
" set showtabline=0 " don't show the tabs
set cmdheight=2 " More space for displaying messages
"""" for windows
set splitbelow " Horizontal splits will automatically be below
set splitright " Vertical splits will automatically be to the right
set autoread " autoreload the file in Vim if it has been changed outside of Vim
set tabstop=2 " Insert 2 spaces for a tab
set softtabstop=4 " backspace after pressing <TAB> will remove up to this many spaces
set expandtab " don't use actual tab character (ctrl-v)
set shiftwidth=2 " Change the number of space characters inserted for indentation
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set smarttab " tab respects 'tabstop', 'shiftwidth' and 'softtabstop'
set autoindent " turns it on
set copyindent " copy the previous indentation on autoindenting
set smartindent " does the right thing (mostly) in programs
set cindent " stricter rules for C programs
set ruler
set conceallevel=0 " So that I can see `` in markdown files
set foldmethod=syntax
set foldnestmax=10
set nofoldenable
set foldlevel=2
" zo opens a fold at the cursor.
" zShift+o opens all folds at the cursor.
" zc closes a fold at the cursor.
" zm increases the foldlevel by one.
" zShift+m closes all open folds.
" zr decreases the foldlevel by one.
" zShift+r decreases the foldlevel to zero -- all folds will be open.
" set title
" set titleold="Terminal"
" set titlestring=%F
" set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\
set guicursor& " set default setting for cursor
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
noremap <Leader>h :<C-u>split<CR>
noremap <Leader>v :<C-u>vsplit<CR>
nnoremap <S-l> gt
nnoremap <S-h> gT
"" Close buffer
noremap <leader>c :bd<CR>
"" Clean search (highlight)
nnoremap <silent> <leader>n :noh<CR>
inoremap <C-l> <Right>
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
" nnoremap <C-p> :bn <CR>
" nnoremap <C-n> :bp <CR>
set ideajoin
nnoremap <leader>ls :action IdeaVim.ReloadVimRc.reload<CR>
nnoremap <c-t> :action ActivateTerminalToolWindow<CR>
nnoremap <leader>t :action Terminal.OpenInTerminal<CR>
nnoremap <leader>c :action CloseContent<CR>
nnoremap <leader>la :action Refactorings.QuickListPopupAction<CR>
nnoremap <Leader>lf :action ReformatCode<CR>
nnoremap <leader>lo :action OptimizeImports<CR>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
" nnoremap <leader>f :action FindInPath<CR>
nnoremap <leader>la :action GotoAction<CR>
nnoremap <leader>f :action GotoFile<CR>
" nnoremap <leader>u :action FindUsages<CR>
nnoremap <leader>st :action ShowNavBar<CR>
" nnoremap <leader>e :action FileStructurePopup<CR>
nnoremap <leader>e :action ActivateProjectToolWindow<CR>
nnoremap gc :action GotoClass<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gd :action GotToDeclaration<CR>
nnoremap gp :action GotToSuperMethod<CR>
nnoremap gt :action GotoTest<CR>
" nnoremap gb :action Back<CR>
" nnoremap gf :action Forward<CR>
map <leader>r <Action>(RenameElement)
map gh <Action>(ShowErrorDescription)
nnoremap <c-z> :action HideAllWindows<CR>