-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideavimrc
93 lines (76 loc) · 2.55 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
" Remap leader from / to Space
let mapleader=" "
" Remap Esc to jj
inoremap jj <Esc>
" Remap Leader-s to Save
nnoremap <Leader>s :w<CR>
set scrolloff=8
" Copy to system clipboard as well
set clipboard+=unnamed
" Multiple cursors support
set multiple-cursors
" Show hybrid line numbers
set number relativenumber
set nu rnu
" Use spaces instead of tabs
set expandtab
set ai "Auto indent
set si "Smart indent
" Enable vim paragraph motion
" set vim-paragraph-motion
" Two-space indents in JSON
autocmd! FileType json set sw=2 sts=2 expandtab
" Tabs:
set smarttab " tab respects `tabstop`, `shiftwidth`, and `softtabstop`
set tabstop=4 " set the length of the \t character (the visible width of tabs)
set softtabstop=4 " number of spaces in tab when editing
set shiftwidth=4 " number of spaces to use for indent and unindent
set expandtab " tabs are spaces
set shiftround " round indent to a multiple of `shiftwidth`
set nowrap
set nolinebreak
set visualbell
set noerrorbells
" Filetype Tabs:
""" ts: number of spaces that \t in file use
""" sts: number of spaces that new \t uses
""" sw: number of spaces for autoindent
autocmd FileType go setlocal ts=4 sts=4 sw=4
autocmd FileType html setlocal ts=2 sts=2 sw=2
autocmd FileType javascript setlocal ts=2 sts=2 sw=2
autocmd FileType typescript setlocal ts=2 sts=2 sw=2
autocmd FileType javascriptreact setlocal ts=2 sts=2 sw=2
autocmd FileType typescriptreact setlocal ts=2 sts=2 sw=2
autocmd FileType python setlocal ts=2 sts=2 sw=2
autocmd FileType ruby setlocal ts=2 sts=2 sw=2
autocmd FileType json setlocal ts=2 sts=2 sw=2
autocmd FileType cpp setlocal ts=2 sts=2 sw=2
autocmd FileType yaml setlocal ts=2 sts=2 sw=2
autocmd FileType yml setlocal ts=2 sts=2 sw=2
autocmd FileType sql setlocal ts=2 sts=2 sw=2
" Code Navigation:
"nnoremap <silent>gD :lua vim.lsp.buf.declaration()<CR>
nnoremap <silent>gd :action GotoDeclaration<CR>
nnoremap <silent>gi :action GotoImplementation<CR>
nnoremap <silent>gr :action FindUsages<CR>
"nnoremap <silent>grn :lua vim.lsp.buf.rename()<CR>
"nnoremap <silent>gh :lua vim.lsp.buf.hover()<CR>
nnoremap <C-e> 5<C-e>
nnoremap <C-y> 5<C-y>
" Map C-j and C-k to move 5 lines up and down
nnoremap <C-j> 5j
nnoremap <C-j> 5k
"
" Create splits
nmap sv :vsplit <CR>
nmap sV <Action>(MoveTabRight)
nmap ss <Action>(MoveEditorToOppositeTabGroup)
" Move between splits
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
" File Navigation
nmap <C-p> <ESC>:action GotoFile<CR>
" Map <leader> fb to open recent files (similar to searching Neovim buffers)
nnoremap <leader>fb <ESC>:action RecentFiles<CR>