<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] # 新建文件模板配置 為了完成根據新建文件的后綴不同,使用不同的模板,我新建了`~/.vim/mconf/file_auto.vim`文件,特地用來配置文件模板的,該違建內容如下: ```vim "本文件配置vim新建文件時自動生成的內容" "=========== "配置新建文件的模板(自動化完成) "=========== "==============================================================================" "cpp文件自動生成模板" autocmd BufNewFile *.cpp exec ":call SetTitle()" func SetTitle() call setline(1,"/**") call append(line("."), " * Copyright (C) ".strftime("%Y")." All rights reserved.") call append(line(".")+1, " *") call append(line(".")+2, " * FileName :".expand("%:t")) call append(line(".")+3, " * Author :hpy") call append(line(".")+4, " * Email :yuan_hp@qq.com") call append(line(".")+5, " * Date :".strftime("%Y年%m月%d日")) call append(line(".")+6, " * Description :") call append(line(".")+7, " */") call append(line(".")+8, "") endfunc "自動將光標定位到末尾" "autocmd BufNewFile * normal G" "==============================================================================" "配置shell腳本新建時的模板" autocmd BufNewFile *.sh exec ":call SetShTitle()" func SetShTitle() call setline(1,"#!/usr/bin/env bash") call append(line("."), "#-------------------------------------------------------") call append(line(".")+1, "# FileName : ".expand("%:t")) call append(line(".")+2, "# Author :hpy") call append(line(".")+3, "# Date :".strftime("%Y年%m月%d日")) call append(line(".")+4, "# Description :") call append(line(".")+5, "#-------------------------------------------------------") call append(line(".")+6, "") endfunc "==============================================================================" "配置verilog腳本新建時的模板" autocmd BufNewFile *.v exec ":call SetVTitle()" func SetVTitle() call setline(1,"`timescale 1ns / 1ps") call append(line("."), "// ********************************************************************") call append(line(".")+1, "// FileName : ".expand("%:t")) call append(line(".")+2, "// Author :hpy") call append(line(".")+3, "// Email :yuan_hp@qq.com") call append(line(".")+4, "// Date :".strftime("%Y年%m月%d日")) call append(line(".")+5, "// Description :") call append(line(".")+6, "// --------------------------------------------------------------------") call append(line(".")+7, "module " .expand("%:r") ."(") call append(line(".")+8, " input clk, ") call append(line(".")+9, " input rst_n") call append(line(".")+10, ");") call append(line(".")+11, " ") call append(line(".")+12, "always@(posedge clk or negedge rst_n)") call append(line(".")+13, "begin") call append(line(".")+14, " if(!rst_n)begin") call append(line(".")+15, " ") call append(line(".")+16, " end ") call append(line(".")+17, " else begin ") call append(line(".")+18, " ") call append(line(".")+19, " end ") call append(line(".")+20, "end") call append(line(".")+21, " ") call append(line(".")+22, "endmodule") endfunc "==============================================================================" "配置tcl腳本新建時的模板" autocmd BufNewFile *.tcl exec ":call SetTclTitle()" func SetTclTitle() call setline(1,"#!/usr/bin/env tclsh") call append(line("."), "#-------------------------------------------------------") call append(line(".")+1, "# FileName : ".expand("%:t")) call append(line(".")+2, "# Author :hpy") call append(line(".")+3, "# Email :yuan_hp@qq.com") call append(line(".")+4, "# Date :".strftime("%Y年%m月%d日")) call append(line(".")+5, "# Description :") call append(line(".")+6, "#-------------------------------------------------------") call append(line(".")+7, "") endfunc "==============================================================================" "配置python3腳本新建時的模板" autocmd BufNewFile *.py exec ":call SetPyTitle()" func SetPyTitle() call setline(1,"#!/usr/bin/env python3") call append(line("."), "# -- coding:utf-8 --") call append(line(".")+1, "#-------------------------------------------------------") call append(line(".")+2, "# FileName : ".expand("%:t")) call append(line(".")+3, "# Author :hpy") call append(line(".")+4, "# Email :yuan_hp@qq.com") call append(line(".")+5, "# Date :".strftime("%Y年%m月%d日")) call append(line(".")+6, "# Description :") call append(line(".")+7, "#-------------------------------------------------------") call append(line(".")+8, "") endfunc "自動將光標定位到末尾" autocmd BufNewFile * normal G ``` # 編輯快捷鍵設置 為了提高編輯的效率,我新建了`~/.vim/mconf/key.vim`文件,主要配置了bash,verilog,tcl,python的一些編輯快捷鍵,并添加了鉚點,使得可以盡量減少使用鼠標的需要。 該文件內容如下所示: ```vim "===================================================================" "===========" "配置markdown編輯時的快捷鍵" "===========" autocmd Filetype markdown inoremap // <Esc>/<CR>:nohlsearch<CR>c4l "加粗" autocmd Filetype markdown inoremap /b **** <Esc>F*hi "添加代碼塊" autocmd Filetype markdown inoremap /[ ```<Enter><++><Enter>```<Enter><Enter> "添加行內代碼" autocmd Filetype markdown inoremap /e ``<++><Esc>F`i "===================================================================" "===========" "配置shell編輯時的快捷鍵" "===========" autocmd Filetype sh inoremap // <Esc>/<++><CR>:nohlsearch<CR>c4l "加粗" autocmd Filetype sh inoremap /e echo "<++>"<++><Esc>/<++><CR>:nohlsearch<CR>c4l "引用" autocmd Filetype sh inoremap /y $(<++>) <++><Esc>/<++><CR>:nohlsearch<CR>c4l "算數運算" autocmd Filetype sh inoremap /a $[<++>]<++><Esc>/<++><CR>:nohlsearch<CR>c4l "if流程" autocmd Filetype sh inoremap /i if [ <++> ];then<Enter><Tab><++><Enter>fi<Esc>/<++><CR>:nohlsearch<CR>c4l "case流程" autocmd Filetype sh inoremap /c case <++> in<Enter><Tab><++>)<++>;;<Enter>esac<Esc>/<++><CR>:nohlsearch<CR>c4l "單引號" autocmd Filetype sh inoremap ' ''<Esc>F'i "雙引號" autocmd Filetype sh inoremap " ""<Esc>F"i "花括號" autocmd Filetype sh inoremap { {}<Esc>F}i "小括號" autocmd Filetype sh inoremap ( ()<Esc>F)i "中括號" autocmd Filetype sh inoremap [ []<Esc>F]i "字符串替換" autocmd Filetype sh inoremap /t ${/<++>/<++>}<++><Esc>F/F/i "===================================================================" "===========" "配置verilog編輯時的快捷鍵" "===========" autocmd Filetype verilog inoremap // <Esc>/<++><CR>:nohlsearch<CR>c4l "always語句" autocmd Filetype verilog inoremap /aa always@(<++>)<Enter>begin<Enter><Tab><++><Enter>end <Esc>/<++><CR>:nohlsearch<CR>c4l "if 語句" autocmd Filetype verilog inoremap /ii if()begin<++>end<Esc>F)i "else 語句" autocmd Filetype verilog inoremap /ee else beginend<++><Esc>Fei "initial 語句" autocmd Filetype verilog inoremap /in initial beginend<Esc>Fei "assign 語句" autocmd Filetype verilog inoremap ass assign = <++><Esc>F=i "module例化 設置" autocmd Filetype verilog inoremap /. .(<++>)<++><Esc>F(i "display 語句" autocmd Filetype verilog inoremap /dd $display()<++><Esc>F)i "parameter 語句" autocmd Filetype verilog inoremap /p parameter <++> = <++>;<Esc>/<++><CR>:nohlsearch<CR>c4l "localparam 語句" autocmd Filetype verilog inoremap /l localparam <++> = <++>;<Esc>/<++><CR>:nohlsearch<CR>c4l "reg 語句" autocmd Filetype verilog inoremap /r reg[ : 0 ] <++><Esc>F:i "wire 語句" autocmd Filetype verilog inoremap /w wire[ : 0 ] <++><Esc>F:i "常量 語句" autocmd Filetype verilog inoremap /d <++>'d<++><Esc>/<++><CR>:nohlsearch<CR>c4l "case 語句" autocmd Filetype verilog inoremap /cc case()<++>endcase<Esc>F)i "begin 語句" autocmd Filetype verilog inoremap /bb beginend<Esc>Fei "function 語句" autocmd Filetype verilog inoremap function function [ <++> : 0 ]<++>;<Enter><++><Enter>endfunction<Esc>/<++><CR>:nohlsearch<CR>c4l "中括號" autocmd Filetype verilog inoremap [ []<Esc>F]i "大括號" autocmd Filetype verilog inoremap { {}<Esc>F}i "小括號" autocmd Filetype verilog inoremap ( ()<Esc>F)i "===================================================================" "===========" "配置 python 編輯時的快捷鍵" "===========" autocmd Filetype python inoremap // <Esc>/<++><CR>:nohlsearch<CR>c4l "print 語句" autocmd Filetype python inoremap /p print()<++><Esc>F)i "多行注釋" autocmd Filetype python inoremap /n '''<++>'''<++><Esc>/<++><CR>:nohlsearch<CR>c4l "if語句" autocmd Filetype python inoremap if if :<++><Esc>F:i "else語句" autocmd Filetype python inoremap else else: "elif語句" autocmd Filetype python inoremap elif elif :<++><Esc>F:i "while 語句" autocmd Filetype python inoremap while while :<++><Esc>F:i "for 語句" autocmd Filetype python inoremap for for <++> in <++> :<++><Esc>/<++><CR>:nohlsearch<CR>c4l "def 函數語句" autocmd Filetype python inoremap def def () :<++><Esc>F(i "input 語句" autocmd Filetype python inoremap input input()<++><Esc>F)i "中括號" autocmd Filetype python inoremap [ []<Esc>F]i "大括號" autocmd Filetype python inoremap { {}<Esc>F}i "小括號" autocmd Filetype python inoremap ( ()<Esc>F)i "單引號" autocmd Filetype python inoremap ' ''<Esc>F'i "雙引號" autocmd Filetype python inoremap " ""<Esc>F"i ``` # 個人.vimrc配置文件 自己的vim配置文件,在這里用于備份,文件包括配置了字體,自動對齊,語法高亮,tab鍵設置,markdown預覽插件,文件樹插件,自動模板和按鍵快捷方式,自動完成等。 文件內容如下所示: ```vim set rtp+=~/.vim/bundle/Vundle.vim "顯示行號 set nu "忽略大小寫 set ignorecase "開啟文件類型檢測 filetype plugin indent on "不忽略大小寫 "set noignorecase "開啟高亮 syntax on "顯示光標當前位置 set ruler "啟用鼠標 set mouse=a "顯示狀態欄 set laststatus=2 "設置字體 set gfn=Noto\ Mono\ 12 "set guifont=Noto\ Mono\:h12 "設置配色方案 gotham256效果較好 "colorscheme industry "colorscheme gotham256 colorscheme gruvbox "設置深色背景 set background=dark "設置背景透明 hi Normal ctermfg=252 ctermbg=none "設置語言環境 set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1 set enc=utf8 set fencs=utf8,gbk,gb2312,gb18030 "============ "設置縮進" "============ set smartindent " 開啟新行時使用智能自動縮進 "set cindent " 按照C語言語法自動縮進 set shiftwidth=4 " 配置縮進空格數為4 set tabstop=4 " 配置TAB鍵移動距離為4個空格 set autoindent "自動對齊 "============ "設置語法折疊" "============ set foldenable " 開始折疊 set foldmethod=syntax " 設置語法折疊 set foldcolumn=0 " 設置折疊區域的寬度 setlocal foldlevel=1 " 設置折疊層數為 "======== "括號匹配" "======== "set showmatch " 插入括號時,短暫地跳轉到匹配的對應括號 "set matchtime=2 " 短暫跳轉到匹配括號的時間 "=========== "配置共用剪切板 "=========== set clipboard=unnamed "實現自動生成匹配的括號" "inoremap ( ()<LEFT> " inoremap { {}<LEFT> inoremap [ []<LEFT> "inoremap ' ''<LEFT> "inoremap " ""<LEFT> "inoremap < <><LEFT> "插件管理安裝 call vundle#begin() Plugin 'gmarik/Vundle.vim' "加載nerdtree Plugin 'preservim/nerdtree' Plugin 'suan/vim-instant-markdown' "markdown預覽插件 Plugin 'ferrine/md-img-paste.vim' "vim編輯markdown放圖插件 call vundle#end() "配置開關nerdtree的快捷鍵 map <f3> :NERDTreeToggle<cr> "配置打開刷新nerdtree的快捷鍵 map <f4> :NERDTree<cr> "修改樹的顯示圖標 let g:NERDTreeDirArrowExpandable = '+' let g:NERDTreeDirArrowCollapsible = '-' ""窗口位置 let g:NERDTreeWinPos='left' ""窗口尺寸 let g:NERDTreeSize=30 ""窗口是否顯示行號 let g:NERDTreeShowLineNumbers=1 ""不顯示隱藏文件 let g:NERDTreeHidden=0 "markdown圖片插件配置 let g:mdip_imgdir = 'img' let g:mdip_imgname = 'image' "粘貼圖片快捷鍵 autocmd FileType markdown nnoremap <silent> <C-p> :call mdip#MarkdownClipboardImage()<CR> "自定義函數 "執行shell的函數 第一個字母大寫,小寫時會自動運行 "在vim中使用不 :call Eshell() 可將正在編輯的文檔執行 ./file命令 func Eshell() !./%< endfunction "nmap <silent> <C-B> :call Eshell()<CR>" "模板配置" source ~/.vim/mconf/file_auto.vim "各文件編輯時快捷鍵配置配置" source ~/.vim/mconf/key.vim ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看