首页 > 其他分享 >我的 vimrc (简化版)

我的 vimrc (简化版)

时间:2024-07-28 16:52:06浏览次数:6  
标签:Plug ---------------------------------------------------------------------------

安装 vim-plug | cnblogs

" 时间:2024年7月26日
" vim 的配置,用标记折叠的方式组织起来,感觉很好

"--------------------------------------------------------------------------------

"# 1. Plug {{{

"## 1.1 plug-vim{{{
"--------------------------------------------------------------------------------

"安装插件 :PlugInstall
"itchyny/lightline.vim 对应的 github 仓库 https://github.com/itchyny/lightline.vim

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

Plug 'itchyny/lightline.vim'
Plug 'easymotion/vim-easymotion'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'junegunn/vim-easy-align'
Plug 'luochen1990/rainbow'
"Plug 'neoclide/coc.nvim', {'tag': '*', 'branch': 'release'}
"Plug 'preservim/nerdcommenter'
"Plug 'preservim/nerdtree'
"Plug 'preservim/tagbar'
"Plug 'simnalamburt/vim-mundo'
Plug 'tpope/vim-surround'
Plug 'morhetz/gruvbox'
Plug 'vim-scripts/DoxygenToolkit.vim'
"Plug 'scrooloose/syntastic'
"Plug 'tpope/vim-fugitive'
"Plug 'kien/ctrlp.vim'
"Plug 'honza/vim-snippets'
"Plug 'SirVer/ultisnips'
"Plug 'shougo/vimproc.vim'
Plug 'elzr/vim-json'
"Plug 'tomtom/tlib_vim'
"Plug 'kana/vim-textobj-user'
"Plug 'tpope/vim-vinegar'
"Plug 'rafi/awesome-vim-colorschemes'

call plug#end()
"}}}

"## 1.2 plugins : limelight, rainbow, EasyAlign {{{
"--------------------------------------------------------------------------------
vnoremap <Enter> <Plug>(EasyAlign)
xnoremap <Leader>g :Goyo<CR>
xnoremap ga <Plug>(EasyAlign)
nnoremap ga <Plug>(EasyAlign)
let mapleader = "\\"
let g:limelight_priority = -1
let g:limelight_eop = '\ze\n^\s'
let g:limelight_bop = '^\s'
let g:limelight_paragraph_span = 1
let g:limelight_default_coefficient = 0.7
let g:limelight_conceal_guifg = '#777777'
let g:limelight_conceal_guifg = 'DarkGray'
let g:limelight_conceal_ctermfg = 240
let g:limelight_conceal_ctermfg = 'gray'
let g:rainbow_active=1

"### limelight
""----------------------------------------
" 问题: unsupported color scheme. g:limelight_conceal_ctermfg required
" " 解决:https://github.com/junegunn/limelight.vim#options
" " Color name (:help cterm-colors) or ANSI code
"
" " Color name (:help gui-colors) or RGB color
"
" " Default: 0.5
"
" " Number of preceding/following paragraphs to include (default: 0)
"
" " Beginning/end of paragraph
" "   When there's no empty line between the paragraphs
" "   and each paragraph starts with indentation
"
" " Highlighting priority (default: 10)
" "   Set it to -1 not to overrule hlsearch
"
"### Goyo
" "----------------------------------------
" "Goyo与Limelight聚和

"inoremap <silent><expr> <Tab> coc#pum#confirm()
"inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
"}}} plugins

"## 1.3 EasyMotion {{{
map <Leader> <Plug>(easymotion-prefix)
nnoremap <c-j> <Plug>(easymotion-w)
nnoremap <c-k> <Plug>(easymotion-b)
"nnoremap <c-;> <Plug>(easymotion-bd-f)
""inoremap <c-;> <Esc><Plug>(easymotion-bd-f)
"}}}

" ## 1.4 DoxygenToolkit {{{
"--------------------------------------------------------------------------------
"Use:
":Dox
":DoxLic
":DoxAuthor
":DoxUndoc(DEBUG)
":DoxBlock
nnoremap <c-c> :Dox<cr>
let g:DoxygenToolkit_commentType          = "C++"
let g:DoxygenToolkit_briefTag_pre         = "\\brief "
let g:DoxygenToolkit_templateParamTag_pre = "\\tparam "
let g:DoxygenToolkit_paramTag_pre         = "\\param "
let g:DoxygenToolkit_returnTag            = "\\return "
let g:DoxygenToolkit_throwTag_pre         = "\\throw " " \\exception is also valid
let g:DoxygenToolkit_fileTag              = "\\file "
let g:DoxygenToolkit_authorTag            = "\\author "
let g:DoxygenToolkit_dateTag              = "\\date "
let g:DoxygenToolkit_versionTag           = "\\version "
let g:DoxygenToolkit_blockTag             = "\\name "
let g:DoxygenToolkit_classTag             = "\\class "
"let g:DoxygenToolkit_blockHeader          = "-------------------------------------------------------------------------------- "
"let g:DoxygenToolkit_blockFooter          = "-------------------------------------------------------------------------------- "
let g:DoxygenToolkit_authorName           = "linlin"
let g:DoxygenToolkit_licenseTag           = "My onw license"
" }}}

" }}} Plug

 "--------------------------------------------------------------------------------

"# 2. 对 Vim 自带设置的更改 {{{
"## 2.1 option : set {{{
"--------------------------------------------------------------------------------

"set softtabstop=4
"set backspace=2         " 修正终端上的退格键 Backspace 的行为
set backspace=3
set shiftwidth=4        " 用于自动缩进的空格数量
set expandtab           " 将制表符 Tab 展开为空格,这对于 Python 尤其有用
set tabstop=4           " tab 的空格数量

" 使用vimscript进行插入的时候,tab会成为8个空格的,所以不要开启的好
               " 自动跟紧上一行的缩进
" autoload-plugin
"packloadall          " 加载所有插件
"silent! helptags ALL " 为所有插件加载帮助文档
"noh                     "清楚高亮显示
filetype on
filetype plugin on
filetype indent on   " 根据文件类型自动缩进

"set showtabline=1
"set guioptions-=T
"set guioptions-=m
"set guifont=Lucida_Console:h18
"set guifont=Courier_New:b:h16
"set completeopt=menu,menuone,noselect

"##自定义状态栏 {{{
"set statusline=[%n]%1*%F%=%0*%2*%l,%c\ %p%%%0*\|ascii=%b,hex=%B%{((&fenc==\"\")?\"\":\"\ \|\ \\".&fenc)}\ \|\ \%{$USER}\ @\ %{hostname()}\    
"set statusline=[%n]\ %#HIComment%F%=\ \|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%B%{((&fenc==\"\")?\"\":\"\ \|\ \\".&fenc)}\ \|\ \%{$USER}\ @\ %{hostname()}\     " 没有效果
"set statusline=[%n]\ %f%m%r%h\ \|\ \ \ \|%=\|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%b%{((&fenc==\"\")?\"\":\"\ \|\\".&fenc)}\ \|\ \%{$USER}\ @\ %{hostname()}\
"set statusline=[%n]\ %f%m%r%h\ \|\ \ pwd:\ %{CurrentDir()}\ \|%=\|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%b%{((&fenc==\"\")?\"\":\"\ \|\\".&fenc)}\ \|\ \%{$USER}\ @\ %{hostname()}\
"}}}

"set textwidth=80       " 限制一行的长度,不错的功能
"set relativenumber     "相对行号
"set paste                      " 开启这个选项,复制进来的文本的换行符就不会乱
"set cindent                        " C 语言的缩进
        ""setlocal nomodifiable
        "setlocal nobuflisted
        "setlocal noswapfile
        "setlocal bufhidden=hide
        "setlocal buftype=nofile
        "setlocal noreadonly
set noswapfile
set nobackup
set noundofile
set virtualedit=all "详细信息去看帮助文档
set runtimepath+=~\\.vim\UltiSnips
set runtimepath+=~\\.vim
set scrolloff=5     " vertical scrolling the cursor distance with bottom
set t_Co=256        " 开启 256 色
set fileencodings=utf-8,gbk
set foldlevel=3
set foldmethod=marker
set laststatus=2
set nowrap
set sidescroll=10       " 自动的滚动文本,当移动的文本没有显示时
set hlsearch            "高亮‘/’搜索到的匹配项
set number              " 显示行号
set mouse=a          " 开启鼠标,默认是不能使用鼠标的
set autoindent " 开启自动缩进
set syntax=on       " 开启语法高亮

"}}} option

"## 2.2 mapping : map {{{
"--------------------------------------------------------------------------------
nnoremap <F2> :NERDTreeToggle<CR>
"nnoremap <F2> :Vexplore<CR>
nnoremap <F3> :tabnew<CR>
nnoremap <F7> :w<CR>
nnoremap <F6> :call me#Compile()<CR>
nnoremap <F8> :wa<CR>
inoremap <F8> <C-R>=ListMonths()<CR>
nnoremap <F8> :w<CR>
nnoremap <F9> :Tagbar<CR>
nnoremap <F10> :wqa<CR>
nnoremap gs :call me#SwitchToSource()<CR>

" 要求保持光标位置不变 # 自定义函数
""--------------------------------------------------------------------------------
noremap cx :call CopyLine()<CR>
nnoremap <Space> <C-d>
nnoremap <LEADER>z ZZ
nnoremap <LEADER>v :Goyo<CR>
nnoremap <LEADER>t <c-w>T
nnoremap <LEADER>sc :!start cmd<CR>
nnoremap <LEADER>o  :tabnew $MYVIMRC<CR>
nnoremap <LEADER>mo :browse oldfiles<CR>
nnoremap <LEADER>i  :call me#CreateImplement()<CR>
nnoremap <LEADER>e  :call me#GenerateDefine()<CR>

nnoremap <c-q> :
"nnoremap <c-v> <c-q> "与终端中的快捷键冲突
nnoremap <C-n> :bel vnew<cr>
nnoremap <C-b> :call me#Compile()<CR>
"nnoremap <c-s> :w<cr>
inoremap <c-q> <Esc>:
"nnoremap <LEADER>d :call append(line('.'), strftime('%c'))<CR>

" }}} map

"## 2.3 autocmd : au {{{
"--------------------------------------------------------------------------------
"au! BufNewFile *.cpp,*.h,*.hpp setlocal foldmethod=syntax
"au! BufRead *.cpp,*.h,*.hpp setlocal foldmethod=syntax
"au! BufRead *.ixx set filetype=cpp
" }}} autocmd

"## 2.4 filetype : cpp {{{
"--------------------------------------------------------------------------------
"}}}

"## 2.5 abbreviations {{{
" --------------------------------------------------------------------------------
"iab ce std::cout <<  << std::endl;<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left> 
"iab ff for(int i = 0; i < n; ++i)<CR>{<CR><SPACE><SPACE><SPACE><SPACE>
"iab rr std::random_device rd;<CR>std::uniform_int_distribution dist(0, 10);
 
"}}} abbr

"## 2.6 python {{{
"--------------------------------------------------------------------------------
if &filetype == "python"
    set foldmethod=indent
endif

"}}} python

"## 2.7 依操作系统版本来进行相应的设置 {{{
""--------------------------------------------------------------------------------
" python 根据安装位置来选择
" windows11
if windowsversion() == "10.0"
    set runtimepath+="D:\\Programs\\Python\\Python311\python311.dll"
    set guifont=AnonymicePro_Nerd_Font_Mono:h16
"windows7
elseif windowsversion() == "6.1"
    "set runtimepath+="D:\\Users\\Programs\\Python\\Python38\\python38.dll"
    set pythonthreedll=D:\\Users\\Programs\\Python\\Python38\\python38.dll 
    colorscheme gruvbox
endif
"}}}

" }}} 对 Vim 自带设置的更改

 "--------------------------------------------------------------------------------

"# 3. 自定义的设置、函数 {{{

"## 3.1 重复行而保持光标位置不变 {{{
""--------------------------------------------------------------------------------
function! CopyLine()
    let l:old_cursor = getcursorcharpos()
    execute "normal vYp"
    call setcursorcharpos(l:old_cursor[1]+1, l:old_cursor[2])
endfunction
"}}}

"## 3.2 补全 complete {{{

"### thesaurus 辞典补全,将一个指定的文件作为数据来源
""--------------------------------------------------------------------------------

"### dictionary
""--------------------------------------------------------------------------------
"将单词放入一个txt文件,以空格分隔或以行分隔,将文件放入dictionary变量中,在插入模式下 Ctrl-X Ctrl-K 触发
"补全
" set dictionary+=$linp/vim/dict/c.txt
" set dict+=~\\vimfiles\\complete\\cpp-keyword.txt
" set dict+=~\\vimfiles\complete\\cpp-std-header.txt
" set dict+=~\\vimfiles\complete\\frq.txt
" set dict+=~/vimfiles/tmp/CMakeLists.txt
" set dict+=~/vimfiles/complete/cmake_command.txt

"### tags
""--------------------------------------------------------------------------------
"需要使用 ctags 程序(请先下载)
"插入模式下 Ctrl-N 触发
"set tags+=D:/Qt/6.5.0/Src/tags
"set tags+=~/vimfiles/tags/tags
"set tags+=D:/user/code/practice/qt/tdesktop/tags
set tags+=D:/Qt/Tools/mingw1120_64/lib/gcc/x86_64-w64-mingw32/11.2.0/include/c++/tags,$lin/libraries/jsoncpp/tags,$lin/libraries/include/lin/tags

"}}}

"## 3.3 my plugin {{{
"--------------------------------------------------------------------------------
"### 使窗口位于中间,并打开顶部打开一个预览窗口
function! PlaceholderWindow()
    "wincmd T
    let winid = win_getid()
    vnew
    vertical resize 55
    call win_gotoid(winid)
    split
    resize 5
    call win_gotoid(winid)
endfunction

command -nargs=0 PWin call PlaceholderWindow()

"if has('gui_running')
  "set imactivatekey=C-space
  "inoremap <ESC> <ESC>:set iminsert=2<CR>
"endif

""" C++ 插入预防宏
"function! Ifndef()
"    let name = input("请输入宏名:")
"    if empty(name) == 1
"        return
"    endif
"        let macro_name = toupper(name) .. "_H_"
"        let content = [
"                    \ "#ifndef " .. macro_name,
"                    \ "#define " .. macro_name,
"                    \]
"        call append(line("0"), content)
"        call append(line("$"), "#endif // " .. macro_name)
"endfunction

""" 查看中文月份
"func! ListMonths()
"    "call complete(col('.'), ['January', 'February', 'March',
"                "\ 'April', 'May', 'June', 'July', 'August', 'September',
"                "\ 'October', 'November', 'December'])
"    let cpp_complete = [
"                \ "std::cout << << std::endl;",
"                \ "int main() { f(); }",
"                \]
"    call complete(col('.'), cpp_complete)
"    "实现光标的移动,在补全使用特殊的参数,在选择后,解析结果,然后移动光标
"    return ''
"endfunc
"}}} plugin

"## 3.4 Register Record {{{

" 清空寄存器
"let @a =""

"宏与复制用的是相同的寄存器
"大写宏名是追加进寄存器
"}}}

"## 3.5 Self Custom Symbol {{{
"--------------------------------------------------------------------------------
"┌─────────────┐
"│             │
"└─────────────┘

    "/zbf": [ "┌─────────────┐", "│             │", "├─────────────┤", "└─────────────┘", "┌", "┬", "┐", "┌", "─", "┐", "┍", "┯", "┑", "╔", "╦", "╗", "├", "┼", "┤", "│", "┼", "│", "┝", "┿", "┥", "╠", "╬", "╣", "└", "┴", "┘", "└", "─", "┘", "┕", "┷", "┙", "╚", "╩", "╝", "┏", "┳", "┓", "┏", "━", "┓", "┎", "┰", "┒", "╔", "═", "╗", "┣", "╋", "┫", "┃", "╋", "┃", "┠", "╂", "┨", "║", "╬", "║", "┗", "┻", "┛", "┗", "━", "┛", "┖", "┸", "┚", "╚", "═", "╝", "╓", "╥", "╖", "╒", "╤", "╕", "┏", "┱", "┐", "┌", "┲", "┓", "╟", "╫", "╢", "╞", "╪", "╡", "┡", "╃", "┤", "├", "╄", "┩", "╙", "╨", "╜", "╘", "╧", "╛", "└", "┴", "┘", "└", "┴", "┘", "┌", "┬", "┐", "┏", "┳", "┓", "╭", "─", "╮", "╱", "─", "╲", "┟", "╁", "┧", "┞", "╀", "┦", "│", "╳", "│", "│", "┼", "│", "┗", "┻", "┛", "└", "┴", "┘", "╰", "─", "╯", "╲", "─", "╱", "┄", "┈", "┉", "┅", "┇", "┋", "┊", "┆" ]
"}}}

"## 3.6 note {{{
"--------------------------------------------------------------------------------

"### platform
""--------------------------------------------------------------------------------

"if has('win32')
    "echo "win32"
"elseif has('unix')
    "echo "unix"
"elseif has ('mac')
    "echo "mac"
"else
    "echo "else"
"endif

"对操作系统版本的判断
"使用 windowsversion() 函数:
"版本:win11 ,结果 10.0

"### 得到当前时间
""--------------------------------------------------------------------------------

"nnoremap <LEADER>d :call append(line('.'), strftime('%c'))<CR>

"### vim 时间相关的函数
""--------------------------------------------------------------------------------

"使用: `:h strftime` 查看相应的介绍

"- strftime
"- localtime
"    - 从 1970 年 1 月开始的秒数
"- getftime
"    - 得到指定文件的最后修改时间,从 1970 年 1 月开始的秒数
"- strptime
"    - 将指定格的字符串时间转换为 Unix 时间戳

"2024-7-27
"我安装了两个插件:
"Plug 'SirVer/ultisnips' 这个插件依赖于 python3
"Plug 'honza/vim-snippets'
"UltiSnips 提供了更方便的获取时间的方法——在编辑的时候

"### { { { } } }
""--------------------------------------------------------------------------------
"这是 vim 的折叠标记



"}}} note

"## 3.7 包含网址的一行,变为 markdown 超链接格式 {{{
function! MDLink()
    execute "normal I[](\<Esc>A)\<Esc>0a"
endfunction

command -nargs=0 MDLink call MDLink()
"}}}

"## 3.8 my variable {{{
"if has('win32')
"    let $mycfg="~/vimfiles/pack/MyVim/start"
"    let $mytmp="~/vimfiles/tmp"
"    let $myinclude="D:\\user\\code\\libraries\\include"
"    let $myhome="D\\user\\code"
"else
"    let $mycfg="~/.vim/pack/MyVim/start"
"    let $mytmp="~/.vim/tmp"
"endif

"}}}

"## 3.9 中文输入法问题 {{{
"https://blog.51cto.com/u_15273875/3858820
":help iminsert
"if has('multi_byte_ime')
    ""没有开启 IME 时的光标背景色
    "hi Cursor guifg=bg guibg=Orange gui=NONE
    ""开启 IME 时的光标背景色
    "hi CursorIM guifg=NONE guibg=Skyblue gui=NONE
    ""关闭 vim 的自动切换 IME 输入法(插入模式和正常模式)
    "inoremap <silent> <ESC> <ESC>:set iminsert=0<CR>
    ""set imi=2
"endif

"if has('gui_running')
  "set imactivatekey=C-space
  "inoremap <ESC> <ESC>:set iminsert=2<CR>
"endif

"}}}

"## 3.10 menu : menu, toolbar {{{
" --------------------------------------------------------------------------------
" 在 vim 中,菜单是一个很强大的功能,但是需要自定义
"amenu ToolBar.BuiltIn21 :call me#Compile()<CR>
"amenu ToolBar.BuiltIn22 :!start subl.exe %<CR>
set runtimepath+=C:/Users/16207/vimfiles/bitmaps
amenu icon=~/vimfiles/bitmaps/main_icon.xpm ToolBar.Test :echo "test"<CR>
"
"gvim toolbar 图标
"2024-07-28 01:19
"https://superuser.com/questions/11289/how-do-i-customize-the-gvim-toolbar
":tmenu ToolBar.taglist Toggle display of the Taglis
":amenu ToolBar.taglist :TlistToggle>
"tmenu 的作用是:工具提示,在鼠标悬停是显示信息
"amenu 决定图标被点击时会发生什么
"
"加上图标
":amenu icon=~/vimfiles/bitmaps/main_icon.bmp ToolBar.taglist :TlistToggle>
"在 windows 图标的格式是 bmp,在 linux 是 xpm ,图标的大小要是 18x18 的。

" ### term_start
"term_start({cmd} [, {options}])			*term_start()*
":call term_start(['sh', '-c', 'echo hello'])

"### pop_menu
" }}} menu

" }}}  自定义的设置、函数

 "--------------------------------------------------------------------------------

"# 4. 使用方法 {{{
"2024-07-28 01:40

"## 4.1 折叠的使用方法 "{{{
"本文件使用标记折叠方法组织内容
"{{{ 折叠中的内容 }}}
":set foldmethod
"查看折叠方法
"
":set foldmethod=marker
"
"有关折叠的快捷键:
":h z
"
"作者常用的(在 normal 模式下使用):
"zM      递归的折叠所有部分
"zR      展开所有折叠的部分(包括递归)
"zm      增加一层(:h foldlevel)折叠
"zr      减去一层折叠
"zc      打开光标下的折叠
"za      打开/关闭光标下的折叠
"zj      去到下一个折叠上
"zk      去到上一个折叠上
"}}}

"## 查找替换 : substitute, find, replace {{{
"2024-07-28 01:16
""--------------------------------------------------------------------------------
" 被替换者: test_123
" 替换者: new_123
" 在同一个目录<dir>中的所有 h 文件中
" :cd <dir>
" :args *.h
" :argdo %s/test_123/new_123/ge | update
" 上面一行命令的解释:
"   argdo 对所有在 args 中的文件执行后面的命令
"   %s/被替换者/替换者/ge
"     g 整个文件的所有符合条件者都被替换
"     e 没有找到的情况,不报错
"   | 用于执行多个命令
"   update 保存对文件执行的操作(只对已经修改的缓冲有效)

"### 查找空行
"/^$

":%s/\<s\>/\r/g
"将单词 s 替换为换行符(注意,这里的文件格式是 dos, set fileformat)

"}}}

"}}} 使用方法

标签:Plug,---------------------------------------------------------------------------
From: https://www.cnblogs.com/lin-hui/p/18328428

相关文章

  • C++实现简化版Qt的QObject(3):增加父子关系、属性系统
    前几天写了文章:C++实现一个简单的Qt信号槽机制C++实现简化版Qt信号槽机制(2):增加内存安全保障之后感觉还不够过瘾,Qt中的QObject体系里还有不少功能特性没有实现。为了提高QObject的还原度,今天我们将父子关系、属性系统等功能也一并实现。接口设计首先,我们设计一下我们的......
  • 小红书教程简化版,从0开始走向专业,小红书-主理人培养计划 (13节)
    课程目录1-小红书分析与拆解.mp42-小红书电商玩法.mp43-小红书基础信息设置10_1.mp44-小红书如何开店?.mp45-小红书店铺设置(1).mp45-小红书店铺设置.mp46-小红书笔记制作与产品发布.mp47-小红书运营的文案与标题.mp48-小红书运营的寻找对标笔记和账号.mp49-小红书运营......
  • 自适应巡航控制技术规范(简化版)
    自适应巡航控制技术规范(简化版)1系统概述2功能需求3性能需求4功能激活条件5功能抑制条件6系统局限性1系统概述  ACC自适应巡航系统可自动控制纵向跟车距离,减轻驾驶员的工作量,即驾驶员无需频繁的踩制动和油门便可完成部分的驾驶任务,但责任主体仍然是......
  • youcomplete的vimrc配置文件demo
    离开youcompleteme,vim的使用体验差很多。下面是vimrc文件中ycm相关配置demo。对于C/C++语言的语法补齐需要安装clangd.setnusetexpandtabsettabstop=4setshiftwidth=4setmouse=asetshell=bashsethlssetencoding=utf-8"YoucomPleteMe:语句补全插件",reftoh......
  • vimrc 配置
    "============VundleSettingStart============setshell=/bin/bashsett_Co=256setnocompatible"beiMproved,requiredsethiddensetfileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936settermencoding=utf-8setencoding=utf-8fi......
  • 个性化配置.vimrc文件
    个性化配置.vimrc文件下面为我一直用的.vimrc文件,可以优化gvim文本文件,增加功能有:1、高亮关键字;2、跟踪鼠标位置;3、显示文本行号;4、重复字自动检索;5、粘贴/复制/全选/剪切快捷方式。setsw=4setts=4"setfo+=mB"setsm"setselection=inclusivesetmousemodel=popupsetn......
  • Vim - vimrc常用配置和插件的使用
    基础常用命令I#跳转到行首并进入编辑A#跳转到行尾并进入编辑j#跳转到下一行.#重复上一次的修改(比如给每一行最后加上";",可以按A将光标移动到行尾,输入;,然后按j跳转到下一行,在按.)C#删除当前光标位置到当前行最后的文本,并进入编辑模式s#删除光标后的一个字......
  • linux命令 --简化版--快速上手
    linux命令--简化版--快速上手系统信息arch显示机器的处理器架构(1)uname-m显示机器的处理器架构(2)uname-r显示正在使用的内核版本dmidecode-q显示硬件系统部件-(SMB[IOS](https://www.2cto.com/kf/yidong/iphone/)/DMI)hdparm-i/dev/hda罗列一个磁盘的......
  • 洛谷题单指南-二叉树-P5076 【深基16.例7】普通二叉树(简化版)
    原题链接:https://www.luogu.com.cn/problem/P5076题意解读:此题本质上是要实现一个二叉搜索树的功能。解题思路:从数据规模10^4来看,只要复杂度在n^2范围内基本上是可以通过的,下面给出两种做法:1、有序数组法对应5个操作的实现逻辑如下:操作一:查x的排名。直接通过二分查找>=x的第......
  • Vim之.vimrc配置
    共享一份.vimrc配置文件。setnocompatible"beiMproved,requiredsetbackspace=indent,eol,startfiletypeoff"required"settheruntimepathtoincludeVundleandinitializesetrtp+=~/.vim/bundle/Vundle.vimcallvu......