LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2016, 10:13 AM   #1
patrick295767
Member
 
Registered: Feb 2006
Distribution: FreeBSD, Linux, Slackware, LFS, Gparted
Posts: 664

Rep: Reputation: 138Reputation: 138
Share your configuration file of VIM best file editor (notepad)


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>
 
Old 08-02-2016, 03:16 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,622
Blog Entries: 40

Rep: Reputation: Disabled
no best evers in my vimrc. It's standard.
 
Old 08-02-2016, 06:23 AM   #3
ereus
LQ Newbie
 
Registered: Apr 2005
Distribution: debian, redhat
Posts: 10

Rep: Reputation: 0
I've this:
Code:
set smartindent
:syntax on
 
Old 08-04-2016, 08:22 AM   #4
9acca9
LQ Newbie
 
Registered: Aug 2016
Posts: 5

Rep: Reputation: Disabled
Hi!
thanks for your config! but...... can you explain de code?? thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Long time to search in 6 GB file using vim editor RHCE_ran Linux - Enterprise 1 08-01-2014 04:58 AM
vim editor copying text to another file cmunger Linux - Newbie 5 03-03-2014 05:59 PM
Notepad++ hang when open file edited in other text editor jao_madn Linux - Software 3 04-22-2012 08:50 AM
Configuration File for Vi or Vim Editor for Syntax Highlighting Hi_This_is_Dev Linux - General 5 09-12-2010 10:33 AM
vim editor no color with .conf,.txt file loplayers Linux - Newbie 2 01-03-2008 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration