mirror of
https://github.com/amix/vimrc
synced 2025-02-28 14:12:51 +08:00
- 添加自定义配置
- 配置打开目录树及最近文件快捷键 - 加入交换上下两行的插件 > 插件来源[cnblog](https://blog.csdn.net/dowemo/article/details/78425352)
This commit is contained in:
parent
3aefdbd21a
commit
c401c8b946
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,7 +4,5 @@ temp_dirs/yankring_history_v2.txt
|
||||
sources_forked/yankring/doc/tags
|
||||
sources_non_forked/tlib/doc/tags
|
||||
sources_non_forked/ctrlp.vim/doc/tags*
|
||||
my_plugins/
|
||||
my_configs.vim
|
||||
tags
|
||||
.DS_Store
|
||||
|
45
my_configs.vim
Normal file
45
my_configs.vim
Normal file
@ -0,0 +1,45 @@
|
||||
" 使用系统剪贴板
|
||||
set clipboard=unnamedplus
|
||||
set ts=4
|
||||
set nu
|
||||
|
||||
map q :q<CR>
|
||||
|
||||
" map w :w<cr>
|
||||
" map b <c-v>
|
||||
|
||||
map t :tabe<space>
|
||||
|
||||
" 使光标位置屏幕中间位置
|
||||
map j gjzz
|
||||
map k gkzz
|
||||
map * *zz
|
||||
map # #zz
|
||||
map n nzz
|
||||
map <S-n> <S-n>zz
|
||||
map <C-o> <C-o>zz
|
||||
map <C-i> <C-i>zz
|
||||
|
||||
map <C-a> ggVG
|
||||
|
||||
" 缩进
|
||||
map <tab> V>
|
||||
map <S-tab> V<
|
||||
map <C-tab> gt
|
||||
|
||||
" 切换目录树窗口
|
||||
map <C-h> :NERDTreeToggle<CR>
|
||||
" 最近文件
|
||||
map <C-e> :MRU<CR>
|
||||
|
||||
|
||||
" 切换窗口
|
||||
" ^[ = Alt
|
||||
map w <C-w>w
|
||||
map h <C-w>h
|
||||
map j <C-w>j
|
||||
map k <C-w>k
|
||||
map l <C-w>l
|
||||
|
||||
" 编辑器模式下复制新行
|
||||
imap <C-d> <Esc>Vypi
|
33
my_plugins/swap_lines/plugin/swap_lines.vim
Normal file
33
my_plugins/swap_lines/plugin/swap_lines.vim
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
function! s:swap_lines(n1, n2)
|
||||
let line1 = getline(a:n1)
|
||||
let line2 = getline(a:n2)
|
||||
call setline(a:n1, line2)
|
||||
call setline(a:n2, line1)
|
||||
endfunction
|
||||
|
||||
function! s:swap_up()
|
||||
let n = line('.')
|
||||
if n == 1
|
||||
return
|
||||
endif
|
||||
|
||||
call s:swap_lines(n, n - 1)
|
||||
exec n - 1
|
||||
endfunction
|
||||
|
||||
function! s:swap_down()
|
||||
let n = line('.')
|
||||
if n == line('$')
|
||||
return
|
||||
endif
|
||||
|
||||
call s:swap_lines(n, n + 1)
|
||||
exec n + 1
|
||||
endfunction
|
||||
|
||||
nmap <silent> <c-k> :call <SID>swap_up()<CR>
|
||||
nmap <silent> <c-j> :call <SID>swap_down()<CR>
|
||||
|
||||
imap <silent> <c-k> :call <SID>swap_up()<CR>
|
||||
imap <silent> <c-j> :call <SID>swap_down()<CR>
|
Loading…
Reference in New Issue
Block a user