随笔 - 544, 文章 - 0, 评论 - 0, 阅读 - 10573
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Linux-安装plug-vim

Posted on   乔55  阅读(95)  评论(0编辑  收藏  举报

安装plug-vim

// 安装plug.vim
cd 
git clone https://github.com/junegunn/vim-plug
mk ~/.vim/autoload -p
cd ~/.vim/autoload
cp ~/vim-plug/plug.vim ./

// 配置~/.vimrc

syntax on
set nu
set norelativenumber

set tabstop=2
set shiftwidth=2
set matchtime=2

set smartindent
set cindent
set autoindent

set ruler
set cursorline

set showmatch
set showcmd

set hlsearch
set incsearch
set ignorecase
set smartcase

set wildmenu



let mapleader=" "
noremap <LEADER><CR> :noh<CR>


noremap n h
map m <nop>
map s <nop>
map S :w<CR>
map Q :q<CR>


map msl :set splitright<CR>:vsplit<CR>
map msh :set nosplitright<CR>:vsplit<CR>
map msk :set nosplitbelow<CR>:split<CR>
map msj :set splitbelow<CR>:split<CR>
map <LEADER>l <C-w>l
map <LEADER>h <C-w>h
map <LEADER>k <C-w>k
map <LEADER>j <C-w>j
map <up> :res +1<CR>
map <down> :res -1<CR>
map <left> :vertical resize-1<CR>
map <right> :vertical resize+1<CR>
map mk :tabn<CR>
map mj :tabp<CR>
map ml :tablast<CR>
map mh :tabfirst<CR>

inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap { {}<Esc>i<Enter><Esc>O
inoremap " ""<Esc>i
inoremap ' ''<Esc>i
inoremap <C-b> <Backspace>
inoremap <C-g> <Down><Right>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-h> <Left>
inoremap <C-l> <Right>

func SkipPair()  
    if getline('.')[col('.') - 1] == ')' || getline('.')[col('.') - 1] == ']' || getline('.')[col('.') - 1] == '"' || getline('.')[col('.') - 1] == "'" || getline('.')[col('.') - 1] == '}'  
        return "\<ESC>la"  
    else  
        return "\t"  
    endif  
endfunc  

inoremap <TAB> <c-r>=SkipPair()<CR>



call plug#begin('~/.vim/plugged')

call plug#end()

相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示