-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
123 lines (91 loc) · 2.81 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
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" the same commands as the original .vimrc configuration.
" You can find a list of commands here: https://jb.gg/h38q75
" Find more examples here: https://jb.gg/share-ideavimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
set NERDTree
" Disable GUI cursor
set guicursor=
" Enable line numbers and relative line numbers
set number
set relativenumber
" Set tab and indentation options
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
" Disable line wrapping
set nowrap
" Search settings
set nohlsearch
set incsearch
" Enable true colors
set termguicolors
" Set scrolloff and signcolumn behavior
set scrolloff=8
set signcolumn=yes
set isfname+=@-@
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
-- Set leader key to space
let mapleader = " "
-- Move selected block of text up or down in visual mode
vmap J :m '>+1<CR>gv=gv
vmap K :m '<-2<CR>gv=gv
" Scroll half-page down/up and keep cursor centered
nmap <C-d> <C-d>zz
nmap <C-u> <C-u>zz
" Search and keep cursor centered
nmap n nzzzv
nmap N Nzzzv
" Paste over a selection without yanking it
xmap <leader>p "_dP
" Yank to system clipboard (works in normal and visual modes)
nmap <leader>y "+y
vmap <leader>y "+y
nmap <leader>Y "+Y
" Delete without yanking (works in normal and visual modes)
nmap <leader>d "_d
vmap <leader>d "_d
" Use Ctrl-c as an alternative to Esc in insert mode
imap <C-c> <Esc>
" Disable the 'Q' command in normal mode
nmap Q <nop>
" Live grep (Find in Path)
nmap <leader>fw :action FindInPath<CR>
" Git files (Search Everywhere, filtered by git files)
nmap <C-p> :action GotoFile<CR>
" accept autocomplete
imap <C-i> :action EditorChooseLookupItem<CR>
" rename
nmap <leader>rn :action RenameElement<CR>
" harpoon related stuff
nmap <C-e> :action ShowHarpoon<CR>
nmap <leader>a :action AddToHarpoon<CR>
nmap <C-h> :action GotoHarpoon1<CR>
nmap <C-j> :action GotoHarpoon2<CR>
nmap <C-k> :action GotoHarpoon3<CR>
nmap <C-l> :action GotoHarpoon4<CR>
nmap <C-]> :action GotoNextError<CR>
nmap <C-[> :action GotoPreviousError<CR>
nmap <leader>k :action ShowErrorDescription<CR>
nmap <C-t> :NERDTreeToggle<CR>
nmap <leader>n :NERDTreeFocus<CR>