Showing posts with label vim. Show all posts
Showing posts with label vim. Show all posts
Sunday, September 14, 2014
Vim - find occurrences in files.
Vim is the editor for anybody using the cli on daily bases. One useful feature it has is the find/grep into files.
Obviously you can exit or suspend vim and do a find or grep however not many know that vim has this built in.
You can simply use vimgrep and the likes - for more info http://vim.wikia.com/wiki/Find_in_files_within_Vim.
Labels:
vim
Monday, October 14, 2013
Vim paste tricks
Vim is cool!
But sometimes can be annoying - for example you edit your file etc. and have
a short snippet of code you want to insert into it, so copy and paste BUT ...
vim has the indent on. Now there are different types of indent and you can try
to turned them off - see Indenting source code.
A neat trick is the :paste option however there are cases where you want to turn off indented
for different reasons. You can use something like this into your .vimrc
function! IndentPasteOff() set noai nocin nosi inde= endfunction function! IndentPasteOn() set ai cin si endfunction nmap _0 :call IndentPasteOff()Now you don't want any indent type _0 and to indent again _1. Happy viming!nmap _1 :call IndentPasteOn() " paste on/off set pastetoggle=
Thursday, November 18, 2010
Vi(vim) column editing
In case that you want to edit by column and you use vi(vim) - this will do it.
To use it, press:
* Ctrl + V to go into column mode
* Select the columns and rows where you want to enter your text
* Shift + i to go into insert mode in column mode
* Type in the text you want to enter. You will see changes ONLY into the first row that you edit !
* Esc to apply your change (or alternately Ctrl+c)
You will now see your changed applied.
To use it, press:
* Ctrl + V to go into column mode
* Select the columns and rows where you want to enter your text
* Shift + i to go into insert mode in column mode
* Type in the text you want to enter. You will see changes ONLY into the first row that you edit !
* Esc to apply your change (or alternately Ctrl+c)
You will now see your changed applied.
Thursday, August 13, 2009
My .vimrc file for vim text editor
I tried a few big names editors but I tell you what for *nix console is nothing else like vi (new vi called vim) ... ok I admit perhaps emacs-nox but I don't use it.
In order to get a little from a lot of options of vim I'll show you my .vimrc file
set softtabstop=2
set shiftwidth=2
set expandtab
set cindent
set smartindent
set autoindent
syntax enable
This enables the indentation and puts spaces instead of tab characters into the file.
For more info see - the following
https://github.com/dioda11/dotfiles
In order to get a little from a lot of options of vim I'll show you my .vimrc file
set softtabstop=2
set shiftwidth=2
set expandtab
set cindent
set smartindent
set autoindent
syntax enable
This enables the indentation and puts spaces instead of tab characters into the file.
For more info see - the following
https://github.com/dioda11/dotfiles
Labels:
command line,
dotfiles,
linux,
vim
Subscribe to:
Posts (Atom)