set clipboard=unnamed,autoselect
名前 | 内容 |
unnamed | ヤンクしたテキストそのままクリップボードにコピー |
autoselect | vim上でハイライトして選択したテキストがクリップボードにコピー |
vim --version | clipboard
cat hoge.txt | xsel -bi
:w !xsel -bi
export DISPLAY=:1.0
set encoding=utf-8 set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8,cp932 set fileformats=unix,dos,mac
オプション | 説明 |
encoding, enc | Vim内部で使われる文字エンコーディングを設定する。 |
fileencoding, fenc | カレントバッファのファイルの文字エンコーディングを設定する。 fileencodingとencodingが異なるとき,書き出しのときに変換が行われる。fencの値で書き出すようになる? |
fileencodings, fencs | fencが空のときにはここの値から設定される。既存のファイルを編集するときに考慮する文字エンコーディングのリストを設定する。 この値の先頭から順番に文字コードを使おうとし,エラーが出ると次の文字コードを試す。うまくいけば,その値をfencの値にする。全部失敗すれば,fencは空になり,そのときはencodingの値が使われる。 |
termencoding, tenc | ターミナルで使われるエンコーディング名。空のときはencodingの値が使われる。 |
utf-8 iso-2022-jp euc-jp sjis cp932
オプション | 説明 |
fileformat, ff | ファイルを読み込んだ入,書き込んだりするときに使う<EOL>(改行コード)を設定する。 |
fileformats, ffs | 想定する改行(<EOL>)の種類を指定する。fencsと同様に先頭から順番に確認して設定される。複数列挙するときはコンマ,で区切る。 |
dos: <CR><NL> unix: <NL> mac: <CR>
if $VIM_CUSTOM != "" source <指定ディレクトリのvimrc> endif
// この配下に、autoload, pluginディレクトリがある(pathogenを使っていない場合は、各pluginのホームディレクトリまで指定する必要あり set runtimepath+=<プラグインDIR> call pathogen#infect()
au BufNewFile,BufRead *.c call s:FTlpc() # これはもともとある行 au BufNewFile,BufRead *.pc call s:FTlpc() # *.pcファイルをCの色付けするように行を追加
$HOME\vimfiles\
$HOME\vimfiles\autoload\pathogen.vim $HOME\vimfiles\bundle\
Error detected while processing function quickhl#manual#this[1]..quickhl#manual#enable[11]..quickhl#manual#refresh[1]..quickhl#windo: line 4: E117: Unknown function: bufwinid E15: Invalid expression: bufwinid('') ==# -1 Error detected while processing function quickhl#manual#this[8]..quickhl#manual#add_or_del[8]..quickhl#manual#refresh[1]..quickhl#windo: line 4: E117: Unknown function: bufwinid E15: Invalid expression: bufwinid('') ==# -1
28 function! quickhl#windo(func, obj) abort "{{{ 29 " [BUG] This function is invoked from WinEnter event. 30 " Unexpectedly, this event is happen before buffer is not shown on window when invoke `pedit file`. 31 " So here I will skip unxexisting buffer(which return `-1`) to avoid E994 error. 32 if bufwinid('') ==# -1 # ★このif文ブロック 33 return 34 endif
:call dein#recache_runtimepath()
:Bookmark
mkdir -p ~/.vim/bundle git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
mkdir -p ~/.vim/dein/repos/github.com/Shougo/dein.vim git clone https://github.com/Shougo/dein.vim.git \ ~/.vim/dein/repos/github.com/Shougo/dein.vim
Error detected while processing function dein#begin..dein#util#_begin..dein#util#_error..<SNR>11_msg2list: line 1: E121: Undefined variable: v:t_list E15: Invalid expression: type(a:expr) ==# v:t_list ? a:expr : split(a:expr, '\n') Error detected while processing function dein#begin..dein#util#_begin..dein#util#_error: line 1: E714: List required Press ENTER or type command to continue
git checkout 1.0
:call dein#recache_runtimepath()
zl
zL
zh
zH
f<ジャンプしたい1文字>
# コマンド入力前 ABCDEFGHIJKLMN * # cfJと入力 ABCDEFGHIJKLMN *
Ctrl + o
Ctrl + i
mq (qは未使用キーならなんでもよい)
`q
:set nowrap
ctags -R --sh-kinds=f --extra=+f
vim -b
:%!xxd
:%!xxd -r
let mapleader = ";"
]c
[c
dp
do
cf<置換したい範囲の最後の1文字>
"<a〜zキー>yy
"<a〜zキー>p
:set ft=sql
:map K(未使用キー) "qp
:noh
$ sed -n l ^[k # <== Alt + kを押した際に表示された (Altだけでは何も表示されない。Alt + 何かで始めて受付ける模様) ^[ # <== Escを押した際に表示された
execute "set <M-k>=\ek" nnoremap <M-k> <何かのコマンド等> " <== これは例
syntax on set ts=4 "tabstop set sw=4 "shiftwidth set expandtab "convert tab to space. set cursorline " Enable Alt + k as <M-k> execute "set <M-k>=\ek" "retab command "if you set expandtab --> convert tab to space. "if you set noexpandtab --> convert space to tab. "set autoindent set hlsearch "set number "set mouse=a "set mouse=n let mapleader = ";"
" ctags set tags=tags; "=========================================== " Turn off beep sound. "=========================================== set vb t_vb= "=========================================== " Cursor type "=========================================== let &t_ti.="\e[1 q" let &t_SI.="\e[5 q" let &t_EI.="\e[1 q" let &t_te.="\e[0 q" "=========================================== " key binding "=========================================== "--- vidual mode --- vnoremap * "zy:let @/ = @z<CR>n "--- edit mode --- nnoremap <C-l> $ " tab jump nnoremap <C-n>t :<c-u>tabnext<CR> nnoremap <C-p>t :<c-u>tabprevious<CR> nnoremap <S-Tab> gt nnoremap <Leader>t gt nnoremap <Leader>T gT "nnoremap <Leader>tn :tabnew<CR> " search word "nnoremap * *zz "nnoremap # #zz nnoremap * *N nnoremap # #n " window jump nnoremap <Leader>ww <C-w>w nnoremap <Leader>wh <C-w>wh nnoremap <Leader>wk <C-w>wk nnoremap <Leader>wj <C-w>wj nnoremap <Leader>wl <C-w>wl " window size vertical nmap <C-w>- <C-w>-<C-w> nmap <C-w>; <C-w>+<C-w> nmap <Leader>w; <C-w>; nmap <Leader>w- <C-w>- " window size width nmap <C-w>, <C-w><<C-w> nmap <C-w>. <C-w>><C-w> nmap <Leader>w. <C-w>. nmap <Leader>w, <C-w>, " ctags as like eclipse " nnoremap <F3> <C-]> nnoremap <F3> g<C-]> " nnoremap <C-k> g<C-]> nnoremap <expr> <C-k> 'tab sp<CR>:tjump ' . expand("<cword>") . '<CR>' nnoremap <expr> <M-k> ':tab sp<CR>:tag ' . expand("<cfile>") . '<CR>' "--- Insert mode --- "move "imap <C-j> <Down> "imap <C-k> <Up> "imap <C-h> <Left> "imap <C-l> <Right> "imap <C-w> <ESC>lwi "imap <C-b> <ESC>bi "imap <C-a> <ESC>0i "escape inoremap <C-j> <ESC> "imap <C-S-f> <ESC>l<C-f>i "imap <C-S-b> <ESC>l<C-b>i "insert line inoremap <C-o> <ESC>o "--- tmp --- "map K "qp "nmap K nvf<s#Response#declare namespace ws='http://ws.mm.nhm.nec.co.jp/'; //ws:getExtractJobBinaryResponse[1]/return[1]}<<ESC> "nnoremap K /jdbc:oracle:thin:@${IP}:${PORT}:${SID}<CR>v37lsjdbc:oracle:thin:@${IP}:${PORT}/${SID}<ESC> " ------------------ " Quick Run " ------------------ nnoremap <silent> <Leader>q :QuickRun nnoremap <silent> <Leader>e <C-w><C-w>:q<CR> let g:quickrun_config={'*': {'split': ''}} set splitbelow set splitright " ------------------ " fuzzy finder " ------------------ nnoremap <silent> <Leader>ff :<C-u>tabnew<CR>:tabmove<CR>:FufFile **/<CR> nnoremap <expr> <Leader>j ':<C-u>tabnew<CR>:tabmove<CR>:FufFile **/' . expand("<cword>") . '<CR>' "nnoremap <silent> <Leader>ff :FufFile **/<CR> "nnoremap <silent> ;ff :FuzzyFinderFile<CR> " old fuzzyfinder " ------------------ " NERDTree " ------------------ nnoremap <Leader>n :NERDTreeToggle<CR> let NERDTreeShowBookmarks=1 " ------------------ " back space effecte " ------------------ set backspace=indent,eol,start inoremap ^? ^H " =========================================== " vim color " =========================================== hi Search ctermfg=black ctermbg=11 " =========================================== " vim diff color " =========================================== hi DiffAdd ctermfg=black ctermbg=2 hi DiffChange ctermfg=black ctermbg=3 hi DiffDelete ctermfg=black ctermbg=6 hi DiffText ctermfg=black ctermbg=7 " =========================================== " vim diff keybind " =========================================== nnoremap dn ]c nnoremap dN [c " ============================================ " completion color " ============================================ set t_Co=256 set t_Sf=[3%dm set t_Sb=[4%dm hi Pmenu ctermbg=8 hi PmenuSel ctermbg=12 hi PmenuSbar ctermbg=0 " ============================================ " XML format " ============================================ map <F5> <ESC>:exe ":silent 1,$!xmllint --format --recover - 2>/dev/null"<CR> " ============================================ " pathogen plugin " ============================================ "call pathogen#infect() let Tlist_Ctags_Cmd = '/usr/local/bin/ctags' " ============================================ " vim-quickhl plugin " ============================================ nmap <Leader>m <Plug>(quickhl-manual-this) xmap <Leader>m <Plug>(quickhl-manual-this) nmap <Leader>M <Plug>(quickhl-manual-reset) xmap <Leader>M <Plug>(quickhl-manual-reset) " for vimdiff color "highlight DiffAdd cterm=bold ctermfg=10 ctermbg=2 "highlight DiffDelete cterm=bold ctermfg=10 ctermbg=3 "highlight DiffChange cterm=bold ctermfg=10 ctermbg=6 "highlight DiffText cterm=bold ctermfg=10 ctermbg=7 " ============================================ " Neobundle Settings. // deprecated " ============================================ " bundleで管理するディレクトリを指定 "set runtimepath+=~/.vim/bundle/neobundle.vim/ " Required: call neobundle#begin(expand('~/.vim/bundle/')) "neobundle自体をneobundleで管理 " NeoBundleFetch 'Shougo/neobundle.vim' " NeoBundle 'mileszs/ack.vim' " NeoBundle 'davidhalter/jedi-vim' " NeoBundle 'vim-scripts/FuzzyFinder' " NeoBundle 'vim-scripts/L9' " NeoBundle 'vim-scripts/taglist.vim' " NeoBundle 'vim-scripts/SQLUtilities' " NeoBundle 'othree/vim-autocomplpop' " NeoBundle 'kevinw/pyflakes-vim' " NeoBundle 'thinca/vim-quickrun' " NeoBundle 't9md/vim-quickhl' " NeoBundle 'Align' " NeoBundle 'rhysd/clever-f.vim' " NeoBundle 'osyo-manga/vim-brightest' " call neobundle#end() " Required: "filetype plugin on " "未インストールのプラグインがある場合、インストールするかどうかを尋ねてくれるようにする設定" "毎回聞かれると邪魔な場合もあるので、この設定は任意です " NeoBundleCheck " ============================================ " dein // NeoBundleがdeprecatedになったのでdeinを使う " ============================================ " プラグインが実際にインストールされるディレクトリ let s:dein_dir = expand('~/.cache/dein') " dein.vim 本体 let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim' " dein.vim がなければ github から落としてくる if &runtimepath !~# '/dein.vim' if !isdirectory(s:dein_repo_dir) execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir endif execute 'set runtimepath^=' . fnamemodify(s:dein_repo_dir, ':p') endif " 設定開始 if dein#load_state(s:dein_dir) call dein#begin(s:dein_dir) " プラグインリストを収めた TOML ファイル " 予め TOML ファイル(後述)を用意しておく let g:rc_dir = expand('~/.vim/rc') let s:toml = g:rc_dir . '/dein.toml' let s:lazy_toml = g:rc_dir . '/dein_lazy.toml' " TOML を読み込み、キャッシュしておく call dein#load_toml(s:toml, {'lazy': 0}) call dein#load_toml(s:lazy_toml, {'lazy': 1}) " 設定終了 call dein#end() call dein#save_state() endif " もし、未インストールものものがあったらインストール if dein#check_install() call dein#install() endif " ============================================ " Ag " ============================================ let g:ackprg = "ag --nogroup --nocolor --column" nnoremap <expr> <C-h> ':<C-u>tabnew<CR>:Ack ' . expand("<cword>") . '<CR>' " For pyflakes color highlight clear SpellBad highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline " ============================================ " vim-easy-align " ============================================ " Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga <Plug>(EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga <Plug>(EasyAlign)
/.vim/rc/dein.toml
[[plugins]] repo = 'Shougo/dein.vim' [[plugins]] repo = 'mileszs/ack.vim' [[plugins]] repo = 'davidhalter/jedi-vim' [[plugins]] repo = 'vim-scripts/FuzzyFinder' [[plugins]] repo = 'vim-scripts/L9' [[plugins]] repo = 'vim-scripts/taglist.vim' [[plugins]] repo = 'vim-scripts/SQLUtilities' [[plugins]] repo = 'othree/vim-autocomplpop' [[plugins]] repo = 'kevinw/pyflakes-vim' [[plugins]] repo = 'thinca/vim-quickrun' [[plugins]] repo = 't9md/vim-quickhl' [[plugins]] repo = 'rhysd/clever-f.vim' [[plugins]] repo = 'scrooloose/nerdtree' [[plugins]] repo = 'rking/ag.vim' [[plugins]] repo = 'osyo-manga/vim-brightest' [[plugins]] repo = 'thinca/vim-fontzoom' [[plugins]] repo = 'junegunn/vim-easy-align'