-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideavimrc
101 lines (81 loc) · 2.08 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
" Find more examples here: https://jb.gg/share-ideavimrc
let mapleader=" "
""" Plugins --------------------------------
Plug 'easymotion/vim-easymotion'
Plug 'machakann/vim-highlightedyank'
set commentary
set surround
set nerdtree
set easymotion
set notimeout
set which-key
set sneak
""" Common settings -------------------------
set scrolloff=10
set linenumber
set showmode
set showcmd
set visualbell
set clipboard+=unnamed
" search
set incsearch
set hlsearch
set ignorecase
set smartcase
set wildignorecase
set showmatch
" ident
set breakindent
set autoindent
set smartindent
" tab
set expandtab
set smarttab
""" Idea specific settings ------------------
set ideajoin
set ideastatusicon=gray
""" My Mappings -----------------------------
map <leader>e <Action>(FileStructurePopup)
map <leader>o <Action>(SelectInProjectView)
" (Open file)
map <leader>n <Action>(OpenFile)
map == <Action>(ReformatCode)
" Goto
map gi <Action>(GotoImplementation)
map gd <Action>(GotoDeclaration)
map gj <Action>(GotoNextError)
map gk <Action>(GotoPreviousError)
" Other actions
map <leader>r <Action>(RecentChangedFiles)
map <leader>R <Action>(RecentFiles)
map <leader>g <Action>(ShowUsages)
map <leader>p <Action>(FindUsages)
map <leader>m <Action>(FindInPath)
" Just makes me nervous
map H h
" I think it's a better solution
map U <C-R>
" Previous buffer
map <leader><tab> :b#<CR>
" Close the current buffer
map <leader>xx :bd<cr>
" Close all the buffers
map <leader>xa :bufdo bd<cr>
" Next/previous buffer
map <leader>l :bnext<cr>
map <leader>h :bprevious<cr>
" Search
map <leader>s <Action>(Find)
map <leader>S <Action>(SearchEverywhere)
map <leader>f <Action>(GotoFile)
map <leader>c <Action>(GotoSymbol)
map <leader>a <Action>(GotoAction)
" Cancel highlight search
nnoremap <silent> <Esc> :nohlsearch<Bar>:echo<CR>
" Custom mappings for insert log
function! InsertConsoleLog()
let word = expand("<cword>")
let linenumber = line(".")
execute "normal A \<BS>\<CR>\<ESC>0Aconsole.log('[" . expand('%:t'). ":" .linenumber. "]', ".word."); \/* TODO *\/"
endfunction
map <silent> <leader>v :call InsertConsoleLog()<CR>