Dear Linux&Coder users,
This thread is to show off what can do VIM.
VIM is a versatile, light-weight, fabulous, file editor. It dates from the origin of Linux, Amiga, with ancestor VI. VIM is probably today the best file editor.
Simply share your ~/.vimrc and you can as well ideally post a screenshot.
Happpy Tux
Here is mine, simple and efficient:
Code:
"___________________________________________________________________
" SOME VIM FUNCTIONS!!
fu! GetChar()
let charadd = input("Enter char to comment lines: ")
return charadd
endfunction
function Comment(fl, ll, paracom)
let i=a:fl
let comment=a:paracom
while i<=a:ll
let cl=getline(i)
let cl2=comment.cl
call setline(i, cl2)
let i=i+1
endwhile
echo "Comments added."
endfunction
"___________________________________________________________________
" The best key ever ! (visual mode on the move,... quick and cool)
imap jj <ESC>
imap kk <ESC>
"___________________________________________________________________
" EDITING very useful
noremap a $<s-a>
map gG <esc>G
map gb <esc>G
"___________________________________________________________________
" QUICK SAVE ON YOUR Pandora, Zaurus, Mac, PC,... (like CNCEDIT):
nmap <F2> :w<cr>
imap <F2> <ESC>:w<cr>
"___________________________________________________________________
" FORCE QUIT (USE WITH CARE)
imap <F10> :q!<CR>
map <F10> :q!<CR>
"___________________________________________________________________
" QUICK MENU
map <space> <c-d>
nnoremap <up> gk
nnoremap <down> gj
map <esc>e :Explore<cr>
map <c-n> :tabn<cr>
"___________________________________________________________________
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
set noswapfile
"___________________________________________________________________
" Bit of Colors
:syntax on
:colorscheme desert
"___________________________________________________________________
" LINUX CODING (Language C is the best of the best!)
map ,5 <Esc>`<:let fl=line(".")<CR>`>:let ll=line(".")<CR>:call Comment(fl, ll, GetChar())<CR>
"___________________________________________________________________
" LINUX TESTING
"___________________________________________________________________
" ZAURUS AND PANDORA (LINUX)
"" extra quick
map gw :w<cr>
map gq :q<cr>
"___________________________________________________________________
"POCKETBOOK LINUX
" 3) Copy the 'vim/etc' directory to 'system/share/vim' on the
" PocketBook - it contains the 'vimrc' initialization file
" read whenever vim is started.
" /mnt/usb/system/share/vim
"
" essential and for testing
map gbce :tabnew $HOME/.vimrc<cr>
map gbs :! cd /tmp ; wget http://mysusuperwebsite/linux/notify.mp3 -O /mnt/ext1/notify.mp3 ; mplayer /mnt/ext1/notify.mp3 <cr>
" menus, cos
nmap gbq :q<cr>
nmap gbQ :q!<cr>
"___________________________________________________________________
"POCKETBOOK LINUX TODO LIST
"todo
map gbw :w! /mnt/ext1/todo.txt<cr>
map gbo :tabnew /mnt/ext1/todo.txt<cr>
function! AddEndFile()
let charadd = input("Enter char to comment lines: ")
let datestring = strftime("%Y%m%d-%H%M%S") . " ; " . charadd . " ; TODO "
put=datestring
:w
endfunction
map ga <Esc>G<Esc>:call AddEndFile()<cr>
map gm <Esc>G<Esc>:call AddEndFile()<cr>
function! Menumain()
:set nospell
while ( 1 )
call AddEndFile()
endwhile
endfunc
" this will run a loop!!
map gbt :call Menumain()<cr>