-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideavimrc
100 lines (85 loc) · 2.47 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
set nobackup
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set nu
set autoindent
set cindent
set nocompatible " be iMproved
set backspace=2 " be iMproved
set cursorline " 突出显示当前行
set clipboard+=unnamedplus
Plug 'nerdtree'
Plug 'vim-easymotion'
" 设置Leader键
let mapleader = "<c-a-f11><c-a-f9>"
" Leader while insert to <alt-,>
imap <a-,> <leader>
nmap , <leader>
" move easy
nnoremap <leader>k <c-u>
nnoremap <leader>j <c-d>
inoremap <leader>k <c-o><c-u>
inoremap <leader>j <c-o><c-d>
nnoremap <A-Up> #
nnoremap <A-Down> *
nnoremap <C-p> #
nnoremap <C-n> *
" save easy
nnoremap <leader>w :w<CR>
nnoremap <leader>q :q<CR>
" configs for NERDTree
nnoremap <leader>nt :NERDTree<CR>
inoremap <leader>nt <esc>:NERDTree<CR>
" usage for easy motion:
" <leader>s
set easymotion
let g:EasyMotion_smartcase = 1
map <Leader>s <Plug>(easymotion-sn)
" Now, all you need to remember is s and JK motions bindings, and it's good enough to boost your cursor speed!
"vim字体大小
set guifont=Consolas:h16
set clipboard+=unnamed
" NOTE: Could use :actionlist to browse actions
" For bookmark
nnoremap <leader>bb :action ToggleBookmark<CR>
nnoremap <leader>ba :action ToggleBookmark<CR>:action EditBookmark<CR>
nnoremap <leader>bs :action ShowBookmarks<CR>
inoremap <leader>bb <esc>:action ToggleBookmark<CR>
inoremap <leader>ba <esc>:action ToggleBookmark<CR>:action EditBookmark<CR>
inoremap <leader>bs <esc>:action ShowBookmarks<CR>
" Highlighter
noremap <M-f> :action MultiHighlight<CR>
noremap <space>e :action MultiHighlight<CR>
noremap <space>c :action MultiHighlight.ClearAction<CR>
" Github Copilot
"nnoremap <leader>rc :action copilot.requestCompletions<CR>
"inoremap <leader>rc <esc>:action copilot.requestCompletions<CR>
" Code Link
function! CodeLink()
action CopyAbsolutePath
let file_name=@+
action CopyPathWithLineNumber
let parameters=split(@+,':')
let lnum=parameters[len(parameters) - 1]
let @+ = "codelink://" . file_name . ":" . lnum
endfunction
nnoremap <leader>url :call CodeLink()<CR>
nnoremap <M-c> :call CodeLink()<CR>
" for quick perforce reference
nnoremap <leader>pt :action CopyAbsolutePath<CR>
" add start tag
func! AddStartTag()
let line_content = "// FIFA_BEGIN | DIVERGENCE | kenzhang | 2023-12-01 | Reason: TODO"
let @+ = line_content
return
endfunc
nnoremap <leader>ts :call AddStartTag()<CR>
" add end tag
func! AddEndTag()
let line_content = "// FIFA_END"
let @+ = line_content
return
endfunc
nnoremap <leader>te :call AddEndTag()<CR>