358 lines
8.7 KiB
Plaintext
358 lines
8.7 KiB
Plaintext
'''
|
||
在用户目录下建立 .vimrc文件,拷贝下面vimrc配置信息
|
||
mkdir -p ~/.vim/autoload/
|
||
|
||
cd ~/.vim/autoload/
|
||
|
||
git clone https://github.com/junegunn/vim-plug
|
||
|
||
cp vim-plug/plug.vim ~/.vim/autoload/plug.vim
|
||
|
||
$ vim #打开vim
|
||
|
||
:PlugStatus #查看插件状态
|
||
|
||
:PlugInstall #安装之前在配置文件中声明的插件
|
||
'''
|
||
|
||
|
||
|
||
|
||
|
||
|
||
" | \/ |_ _ \ \ / /_ _| \/ | _ \ / ___|
|
||
" | |\/| | | | | \ \ / / | || |\/| | |_) | |
|
||
" | | | | |_| | \ V / | || | | | _ <| |___
|
||
" |_| |_|\__, | \_/ |___|_| |_|_| \_\\____|
|
||
" |___/
|
||
|
||
"
|
||
" =.-.\|||||/.-.=
|
||
" =( \\|||// )=
|
||
" //\ /\\
|
||
" //| __ __ |\\
|
||
"_______________ /|| \O\ /O/ ||\ _______________
|
||
"\_________ `-. /|\ " " /|\ .-' _________/
|
||
" \________ \|/|\_`-v-'_/|\|/ ________/
|
||
" \_______ | /|\._:_./|\ | _______/
|
||
" \______ | /|\___/|\ | ______/
|
||
" `-.| |/|||\| |.-'
|
||
" _| | | |_ .ww.
|
||
" / | | | | \ =WWW/
|
||
" | | | | | | =WWW/
|
||
" | | | | | | =WW/
|
||
" | | \ / | | ) )
|
||
" \ \ \ / / /`-.___/ /
|
||
" (...(...)---(...)...)-.__..'
|
||
"
|
||
|
||
"
|
||
" ____ __ ___
|
||
" / ___| _ __ __ _ ___ ___ \ \ / (_)_ __ ___
|
||
" \___ \| '_ \ / _` |/ __/ _ \____\ \ / /| | '_ ` _ \
|
||
" ___) | |_) | (_| | (_| __/_____\ V / | | | | | | |
|
||
" |____/| .__/ \__,_|\___\___| \_/ |_|_| |_| |_|
|
||
" |_|
|
||
"
|
||
"
|
||
"
|
||
"
|
||
"
|
||
|
||
|
||
" 设置书签
|
||
let g:startify_bookmarks = [
|
||
\ '~/vimwiki/1.txt',
|
||
\ '~/vimwiki/redme.txt',
|
||
\ '~/vimwiki/pyt_lx.py',
|
||
\ '~/vimwiki/pytlen_test.md',
|
||
\ '~/vimwiki/bookmark20030312.md',
|
||
\ '~/vimwiki/bookmarksc20231010.md',
|
||
\]
|
||
|
||
" 起始页显示的列表长度
|
||
let g:startify_files_number = 20
|
||
|
||
" 是否自动加载目录下的Session.vim, 很好用
|
||
let g:startify_session_autoload = 1
|
||
|
||
" 过滤列表,支持正则表达式
|
||
let g:startify_skiplist = [
|
||
\ '\.vimgolf',
|
||
\ '^/tmp',
|
||
\ '/project/.*/documentation',
|
||
\ ]
|
||
|
||
"自定义Header和Footer
|
||
let g:startify_custom_header = [
|
||
\ ' ____ __ ___ ',
|
||
\ ' / ___| _ __ __ _ ___ ___ \ \ / (_)_ __ ___ ',
|
||
\ ' \___ \| _ \ / _` |/ __/ _ \____\ \ / /| | _ _ \ ',
|
||
\ ' ___) | |_) | (_| | (_| __/_____\ V / | | | | | | | ',
|
||
\ ' |____/| .__/ \__ _|\___\___| \_/ |_|_| |_| |_| ',
|
||
\ ' |_| ',
|
||
\ ' ',
|
||
\]
|
||
|
||
let g:startify_custom_footer = [
|
||
\ '+------------------------------+',
|
||
\ '| Keep an open mind! |',
|
||
\ '+----------------+-------------+',
|
||
\]
|
||
|
||
|
||
|
||
|
||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
||
\ 'syntax': 'markdown', 'ext': '.md'}]
|
||
|
||
|
||
|
||
|
||
autocmd FileType python set omnifunc=pythoncomplete#Complete
|
||
|
||
filetype plugin on
|
||
set nocompatible
|
||
set t_Co=256
|
||
|
||
|
||
|
||
set background=dark " Setting dark mode
|
||
let g:deus_termcolors=256
|
||
colorscheme evening
|
||
|
||
|
||
|
||
|
||
set encoding=utf-8
|
||
set langmenu=zh_CN.UTF-8
|
||
" 设置打开文件的编码格式
|
||
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
|
||
set fileencoding=utf-8
|
||
" 解决菜单乱码
|
||
source $VIMRUNTIME/delmenu.vim
|
||
source $VIMRUNTIME/menu.vim
|
||
" 解决consle输出乱码
|
||
" set termencoding = cp936
|
||
"设置中文提示
|
||
language messages zh_CN.utf-8
|
||
" 设置中文帮助
|
||
set helplang=cn
|
||
" 设置为双字宽显示,否则无法完整显示如:☆
|
||
set ambiwidth=double
|
||
" 总是显示状态栏
|
||
|
||
|
||
"关闭警告音
|
||
set vb t_vb=
|
||
|
||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||
" keyboard-binding "
|
||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||
|
||
"Vim 与系统剪切板共享
|
||
set clipboard=unnamed
|
||
" 设置快捷键将选中文本块复制至系统剪贴板
|
||
|
||
inoremap ( ()<ESC>i
|
||
inoremap [ []<ESC>i
|
||
inoremap { {}<ESC>i
|
||
inoremap " ""<ESC>i
|
||
set nu "设置显示行号
|
||
set ruler "设置标尺
|
||
set autoindent "设置自动缩进(与上一行的缩进相同)
|
||
set completeopt=preview,menu
|
||
set autowrite
|
||
"set tabstop=2 "设置tab健的长度为2
|
||
set tabstop=4
|
||
set shiftwidth=4
|
||
"set expandtab
|
||
"set wildmenu
|
||
syntax enable
|
||
"syntax on "代码高亮
|
||
colorscheme desert
|
||
|
||
|
||
set history=50 " keep 50 lines of command line history
|
||
syntax enable
|
||
set cursorline
|
||
set laststatus=2 "命令行为两行
|
||
set laststatus=2 "永远显示状态栏
|
||
|
||
set incsearch "开启实时搜索
|
||
set ignorecase "开启大小写不敏感
|
||
|
||
"设置自己的Leader
|
||
let mapleader=","
|
||
"关于保存退出
|
||
nmap <Leader>w :w<CR>
|
||
nmap <Leader>q :q!<CR>
|
||
"处理复制粘贴
|
||
vnoremap <Leader>y "+y
|
||
nmap <Leader>p "+p
|
||
|
||
nmap J 3k
|
||
nmap K 3j
|
||
nmap H ^
|
||
nmap L $
|
||
|
||
map <F3> :NERDTree<CR>
|
||
imap <F3> <ESC>:NERDTreeToggle<CR>
|
||
map T :NERDTree<CR>
|
||
map s <nop>
|
||
map S :w<CR>
|
||
map Q :q<CR>
|
||
map R :source $MYVIMRC<CR>
|
||
inoremap jk <esc> " 映射插入模式下的 jk 键为 ESC 键
|
||
inoremap vv <esc> " 映射插入模式下的 vv 键为 ESC 键
|
||
|
||
map <F5> :w<cr>:!python3 %<cr>
|
||
map P :w<cr>:!python3 %<cr>
|
||
|
||
map<F6> :w<cr>:!kotlin %<cr>
|
||
map K :w<cr>:!kotlin %<cr>
|
||
map <F7> :w<cr>:!dart %<cr>
|
||
map D :w<cr>:!dart %<cr>
|
||
map <F8> :w<cr>:!julia %<cr>
|
||
|
||
|
||
filetype on "文件类型检测
|
||
filetype plugin on "不同文件类型加载不同插件
|
||
set nocompatible
|
||
syntax on
|
||
|
||
|
||
|
||
let g:ale_linters = {'python': ['flake8']}
|
||
let g:airline_powerline_fonts =8
|
||
|
||
|
||
let g:vimwiki_list = [{'path': '~/vimwiki/',
|
||
\ 'syntax': 'markdown', 'ext': '.md'}]
|
||
|
||
let g:vimwiki_list = [{
|
||
\ 'auto_export': 1,
|
||
\ 'automatic_nested_syntaxes':1,
|
||
\ 'path_html': '$HOME/Sync/wiki_html',
|
||
\ 'path': '$HOME/Sync/wiki',
|
||
\ 'template_path': '$HOME/Sync/wiki/template/',
|
||
\ 'syntax': 'markdown',
|
||
\ 'ext':'.md',
|
||
\ 'template_default':'markdown',
|
||
\ 'custom_wiki2html': '$HOME/Sync/wiki2html.sh',
|
||
\ 'template_ext':'.html'
|
||
\}]
|
||
|
||
au BufRead,BufNewFile *.md set filetype=vimwiki
|
||
|
||
let g:taskwiki_sort_orders={"C": "pri-"}
|
||
let g:taskwiki_syntax = 'markdown'
|
||
let g:taskwiki_markdown_syntax='markdown'
|
||
let g:taskwiki_markup_syntax='markdown'
|
||
|
||
|
||
""指定插件目录
|
||
call plug#begin('~/.vim/plugged')
|
||
|
||
""插件允许使用任何有效的git URL
|
||
Plug 'valid git URL'
|
||
|
||
""插件的简写符号
|
||
Plug 'linuxidc/linux'
|
||
|
||
""初始化插件系统
|
||
call plug#end()
|
||
|
||
|
||
call plug#begin('~/.vim/plugged')
|
||
|
||
"自动括号匹配插件
|
||
Plug 'jiangmiao/auto-pairs'
|
||
|
||
"快速对齐补全符号插件
|
||
Plug 'anyakichi/vim-surround'
|
||
|
||
|
||
"提供嵌套括号高亮
|
||
Plug 'luochen1990/rainbow'
|
||
|
||
"语法高亮
|
||
Plug 'sheerun/vim-polyglot'
|
||
|
||
"Vim配置状态栏
|
||
"Plug 'itchyny/lightline.vim'
|
||
"Plug 'Lokaltog/vim-powerline'
|
||
|
||
"配色方案插件
|
||
Plug 'theniceboy/vim-deus'
|
||
|
||
"Markdown 插件
|
||
Plug 'godlygeek/tabular' "必要插件,安装在vim-markdown前面
|
||
Plug 'plasticboy/vim-markdown'
|
||
|
||
"Vim启动屏幕
|
||
Plug 'mhinz/vim-startify'
|
||
|
||
"状态栏和标签栏
|
||
Plug 'vim-airline/vim-airline'
|
||
Plug 'vim-airline/vim-airline-themes'
|
||
|
||
|
||
"julia代码补全插件
|
||
Plug 'JuliaEditorSupport/julia-vim'
|
||
|
||
"python语法插件
|
||
Plug 'hdima/python-syntax'
|
||
|
||
"kotlin插件
|
||
Plug 'udalov/kotlin-vim'
|
||
|
||
"python依赖插件
|
||
"Plug 'davidhalter/jedi-vim'
|
||
|
||
"文件搜索
|
||
Plug 'Yggdroot/LeaderF'
|
||
|
||
Plug 'vimwiki/vimwiki'
|
||
Plug 'itchyny/lightline.vim'
|
||
|
||
"目录树插件
|
||
Plug 'preservim/nerdtree'
|
||
|
||
"The CTRL-P Plugvim ctrl-p补齐功能
|
||
Plug 'kien/ctrlp.vim'
|
||
|
||
Plug 'tpope/vim-fugitive' " git 工具
|
||
|
||
" 快速在 markdown 文件中粘贴图片
|
||
Plug 'ferrine/md-img-paste.vim'
|
||
|
||
" markdown 中自动对齐表格
|
||
Plug 'dhruvasagar/vim-table-mode'
|
||
|
||
"PDF支持插件
|
||
Plug 'vim-pandoc/vim-pandoc'
|
||
Plug 'vim-scripts/pdf.vim'
|
||
|
||
|
||
|
||
"异步语法检查
|
||
Plug 'W0rp/ale'
|
||
:
|
||
"markdown预览插件
|
||
function! BuildComposer(info)
|
||
if a:info.status != 'unchanged' || a:info.force
|
||
if has('nvim')
|
||
!cargo build --release --locked
|
||
else
|
||
!cargo build --release --locked --no-default-features --features json-rpc
|
||
endif
|
||
endif
|
||
endfunction
|
||
|
||
Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') }
|
||
|
||
|
||
|
||
call plug#end()
|