This is my config file for vim with spf-13.
Here is the step to fellow me:
In Ubuntu, some packages are needed to be installed to complie Vim.
sudo apt install libncurses5-dev python-dev perl libperl-dev ruby ruby-dev lua5.3 liblua5.3 liblua5.3-dev
Some time,headers and shared library should be soft linked to correct location.
sudo ln -sf /usr/include/lua5.3/*.* /usr/include
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/liblua.so
In ArchLinux, Install Vim with sudo pacman -S gvim
In Ubuntu, you need to complie Vim form source,when config you need to run this
./configure --with-features=huge --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-perlinterp --with-python-config-dir=/usr/lib/python2.7/config/ --enable-gui=gtk2 --enable-cscope --enable-fail-if-missing
rember to change the with-pyton-config-dir
if python3 is wantted:
./configure --with-features=huge --enable-rubyinterp --enable-luainterp --enable-perlinterp --with-python3-command=python3.5 --with-python3-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu --enable-python3interp --enable-gui=gtk2 --enable-cscope --enable-fail-if-missing
- git clone https://github.com/rxy0424/vimrc.git
- run ./install.py in vimrc directory
3. Install the changed spf-13
The spf-13 i forked control plugins with vim-plug,you can install this version by
curl https://raw.githubusercontent.com/rxy0424/spf13-vim/feature/vim-plug/bootstrap.sh -L > spf13-vim.sh && sh spf13-vim.sh
if you use ArchLinux
sudo pacman -S python-pip clang
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer --system-libclang
if you use Ubuntu
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
install tmux >=2.1 and oh-my-tmux, you need xsel for copying to system clipboard,
If you use ubuntu install
sudo apt-get install libevent-dev automake
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure && make
To install oh-my-tmux
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
To compline
<ctrl-r>
in shell is updated by fzf, give it a try.
vim **<tab>
show file in pwd, <ctrl-j>
for down and <ctrl-j>
for up, <tab>
for select, similar for ssh. Particular, kill -9 <tab>
does need **
Under normal mode, -
opens the current file directory
<CR>
Opens file at cursor.
{Visual}I
{Visual}<CR>
Opens selected files.
o
Opens in horizontal split.
{Visual}O
Opens selected files in horizontal splits.
a
Opens in vertical split.
{Visual}A
Opens selected files in vertical splits.
K
Shows file info.
{Visual}K
Shows info about selected files.
p
Previews file at cursor.
CTRL-N
Previews the next file.
CTRL-P
Previews the previous file.
<leader>jc
jump to Declaration.
<leader>jd
jump to Definition.
<leader>ji
jump to include.
<tab>
for select for completion, <c-k>
for the previous one.
<c-e>
expand snips
<c-j>
jump forward
<c-k>
jump backward
<c-p>
list for files in project
<leader>m
list for most recent used file
<leader>f
list for functions in this file
<leader>b
list for buffers in vim
<leader>t
list for tags in this file
Once LeaderF is launched:
Command | Description |
---|---|
<C-C> <ESC> |
quit from LeaderF |
<C-R> |
switch between fuzzy search mode and regex mode |
<C-F> |
switch between full path search mode and name only search mode |
<Tab> |
switch to normal mode |
<C-V> <S-Insert> |
paste from clipboard |
<C-U> |
clear the prompt |
<C-J> <Down> |
move the cursor downward in the result window |
<C-K> <Up> |
move the cursor upward in the result window |
<2-LeftMouse> <CR> |
open the file under cursor or selected(when multiple files are selected) |
<C-X> |
open in horizontal split window |
<C-]> |
open in vertical split window |
<C-T> |
open in new tabpage |
<F5> |
refresh the cache |
<C-LeftMouse> <C-S> |
select multiple files |
<S-LeftMouse> |
select consecutive multiple files |
<C-A> |
select all files |
<C-L> |
clear all selections |
<BS> |
delete the preceding character in the prompt |
<Del> |
delete the current character in the prompt |
<Home> |
move the cursor to the begin of the prompt |
<End> |
move the cursor to the end of the prompt |
<Left> |
move the cursor one character to the left in the prompt |
<Right> |
move the cursor one character to the right in the prompt |
<C-P> |
preview the result |
generate tags for you in project in ~/.cache/tags, and add it to tags path in vim
ctags
is needed.
ripgrep
is needed for this plugin.
-
Run
:CtrlSF [pattern]
, it will split a new window to show search result. -
If you are doing an asynchronous searching, you can explore and edit other files in the meanwhile, and can always press
Ctrl-C
to stop searching. -
In the result window, press
Enter
/o
to open corresponding file, or pressq
to quit. -
Press
p
to explore file in a preview window if you only want a glance. -
You can edit search result as you like. Whenever you apply a change, you can save your change to actual file by
:w
. -
If you change your mind after saving, you can always undo it by pressing
u
and saving it again. -
:CtrlSFOpen
can reopen CtrlSF window when you have closed CtrlSF window. It is free because it won't invoke a same but new search. A handy command:CtrlSFToggle
is also available. -
If you prefer a quickfix-like result window, just try to press
M
in CtrlSF window.
You are welcome to PR.