顯示具有 Vim 標籤的文章。 顯示所有文章
顯示具有 Vim 標籤的文章。 顯示所有文章

2021年2月3日 星期三

[vim] python 的縮排

 參考這篇

```

filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab

```


 

2020年5月16日 星期六

2018年1月20日 星期六

[VIM] 常用

cheat sheet
https://vim.rtorr.com/lang/zh_tw/

[Linux] - 將vim打造成source insight
http://ivan7645.github.io/2016/07/12/vim_to_si/

用這篇的就可以把 VIM 用得很漂亮,但切到 NERD_tree 要用 shift+j 和 shift+k跳頁
http://ivan7645.github.io/2016/07/12/vim_to_si/


Error when opening nerdtree. Undefined variable: g:NERDTreeGlyphReadOnly, g:NERDTreeDirArrowCollapsible, and s:dirArrows
https://github.com/scrooloose/nerdtree/issues/643

2017年11月26日 星期日

[vim] 建立 Python 編輯環境

一直都沒有好好弄個適合的開發環境, 參考這幾篇應該有幫助

http://codingpy.com/article/vim-and-python-match-in-heaven/
https://blog.gtwang.org/linux/vundle-vim-bundle-plugin-manager/
http://www.jianshu.com/p/f0513d18742a


這篇的直接使用就蠻好看的
http://blog.csdn.net/u013475704/article/details/52295157

但要先裝這幾個套件
$ sudo apt install vim-python-jedi
$ sudo apt-get install exuberant-ctags  

2017年10月12日 星期四

[vim] 停止 visual 模式

修改 .vimrc

set mouse-=a

2016年6月29日 星期三

[Vim] taglist速記

下載:
http://vim.sourceforge.net/scripts/script.php?script_id=273

安裝:
$ mkdir ~/.vim
$ cd ~/.vim
 $ unzip taglist.zip

啟用:
$ vim ~/.vimrc
filetype plugin on

使用:
:TlistOpen

加進 .vimrc (按 F12 開啟)
nnoremap :TlistOpen 

幾個用法: 
s                    更改排序方式,在按名字排序和按出現順序排序間切換 
x                    taglist窗口放大和縮小,方便查看較長的tag  
<Space>         顯示tag的原型定義

視窗切換: 
1. Control+W followed by W to toggle between open windows and, 
2/ Control+W followed by H/J/K/L to move to the left/bottom/top/right window accordingly. 

2016年5月23日 星期一

[Tips] 超簡單 vim + cscope

http://softsmith.blogspot.tw/2009/01/vim-cscope-trace.html?m=1

進階一點的使用
http://www.cnblogs.com/zhangsf/archive/2013/06/13/3134409.html

2015年6月26日 星期五

[Vim] 給Python的.vimrc超基本設定

syntax on
set t_Co=256
set bg=dark
set modeline
set shiftwidth=4
set softtabstop=4
set expandtab
set background=dark

2014年3月20日 星期四

[Vim] 去除^M

:%s/<Ctrl-V><Ctrl-M>//g
<Ctrl-V>表示組合鍵Ctrl+V , <Ctrl-M>表示組合鍵Ctrl+M
Ctrl+V是讓Vim顯示^字元

reference: 
* How to convert the ^M linebreak to 'normal' linebreak in a file opened in vim?

2011年1月11日 星期二

[Vim] .vimrc

筆記一下我目前在用的.vimrc

"=== basic ==="
filetype plugin on        "plugin enable
filetype indent on        "auto indent

"=== encoding ==="
set encoding=utf-8        "enc
set fileencodings=utf-8,gbk,big5,cp950,gb18030,gb2312   "fenc
set termencoding=utf-8    "tenc

"=== editing ==="
syntax on
set nocompatible
set backspace=indent,eol,start
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set ic                    "ignorecase
set ru                    "position
set nu                    "line number
set hls                   "hlsearch
set confirm
set wrapscan
set history=1000
set laststatus=2
set statusline=%4*%<\%m%<[%f\%r%h%w]\ [%{&ff},%{&fileencoding},%Y]%=\[Position=%l,%v,%p%%]

"=== buffer ==="
set clipboard+=unnamed

"=== color scheme ==="
set t_Co=256
colorscheme blackbeauty   "for java
colorscheme leo           "for c/c++

"=== vim ==="
autocmd FileType java runtime! autoload/javacomplete.vim
autocmd Filetype java setlocal omnifunc=javacomplete#Complete
autocmd Filetype java set completefunc=javacomplete#CompleteParamsInf
inoremap   
inoremap   

"=== tab ==="
nmap tc :tabnew
nmap te :tabedit
nmap tm :tabmove
nmap tk :tabclose

"=== folding ==="
set foldenable
set foldlevel=10000

2011年1月3日 星期一

[Vim] Color scheme

用Vim寫程式時通常會對原有的配色不太滿意,尤其是在切換不同的程式語言時會更有這樣的需求,強大的Vim有colorscheme這樣的好物

googlecode上有個專案已經幫我們整理好許多可用的color scheme,比如說寫C/C++的,或是寫Java的都可以在這邊找找看

使用/安裝color scheme相當簡單,
1.先建立存放顏色的目錄
$ mkdir ~/.vim/colors
2.看到喜歡的,下載{COLOR_SCHEME}.vim到colors目錄下
$ mv /path/to/{COLOR_SCHEME}.vim ~/.vim/colors
3.修改Vim顏色設定,我目前是用blackbeautyleo
$ vim ~/.vimrc
set t_Co=256              "support 256 colors
colorscheme blackbeauty   "blackbeauty is the name of color scheme
colorscheme leo           "leo is the name of color scheme
4.在Vim中使用
:colorscheme COLOR_SCHEME

2010年12月26日 星期日

[Vim] Some plugins for Vim

紀錄一下我在用的plugin,隨時會更新

1.Comment/Un-Comment
How to use?
<Ctrl-C> To comment
<Ctrl-X> To un-comment
How to install?
For VIM 6 and higher, stick this file in your ~/.vim/plugin directory or in some other 'plugin' directory that is in your runtime path