" Switch syntax highlighting on, when the terminal has colors syntax on" Also switch on highlighting the last used search pattern. set hlsearch" Turn on line numbers set nu" Turn on auto indention features. Use ESC to exit indention. set ai

All useful settings. I love the syntax high-lighting in vim and I don't think I could work half as well without it. Something to be aware of is that vim assumes you are working on a console with a light background. If your console colour scheme has a dark background you may want to add this.

Code:

set background=dark

It changes the syntax high-light colours to use lighter colours and making them contrast better with a dark background. You can also set it to light if you have a light console.

Given below are some settings I use in my vimrc. I primarily work on Windows and use GVim many times.

It should work on Linux as well. Hope it helps.

Code:

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Setting options start.""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Make vim not compatible with Viset nocompatible""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set syntax onsyntax on""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set filetype related settingsfiletype plugin indent on""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set Numbersset nu""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Dont crazy indent copy-pasted stuff in terminal vim."Hit <F2> when in insert mode and paste. Hit <F2> again when done.set pastetoggle=<F2>""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Allow to open a new file even when I have unwritten changes in the existing file. "Also, undo buffers and marks are preserved while the buffer is open.set hidden""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Ignore case while searchingset ignorecase""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Highlight as I type the words while searching.set incsearch""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""If I Search/SEArch/sEaRcH etc , then highlight Search/SEArch/sEaRcH "else highlight the word search without any regard for case.set smartcase""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Make cursor jump to the matching bracket.set showmatch""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Set Autoindentset autoindent""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Do smart autoindenting when starting a new line."Generally enabled after setting autoindentset smartindent""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Show the line and column number of the cursor position, separated by a comma."Displays Top/Bot/File %set ruler""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Disable beepingset noerrorbells""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Flash the screen (visual bell)set visualbell""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Show the mode (Insert/Visual etc) in the lower left corner of the screen.set showmode """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Show the command I am running.set showcmd""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Enable mouse in "a"ll aspectsset mouse=a""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Set history and undolevelsset history=1000set undolevels=1000""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Tab completion cycle-through shows up in the statuslineset wildmenu""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Set backspace to behave betterset backspace=2set backspace=indent,eol,start""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Change the current working directory whenever you open a file, switch buffers,"delete a buffer or open/close a window."Note: When this option is on some plugins MAY NOT work.set autochdir""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Damian Conway's clever hack. "Make the color column visible only when the line actually crosses over."Please note - Does not seem to work with Centos (7.2) vim.set colorcolumn=0call matchadd('ColorColumn', '\%81v', 100)""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""set encodingsset encoding=utf-8set fileencodings=ucs-bom,utf-8,latin1set termencoding=utf-8scriptencoding utf-8setglobal fileencoding=utf-8""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Set swap, backup and undo directories."NOTE - You have to create these yourself. "Vim will NOT create them automatically."Set swapfiles directory"set directory=$HOME/.vim/vimswap//

"Set backup files directory"set backupdir=$HOME/.vim/vimbkup//

"Set undo directory"set undodir=$HOME/.vim/vimundo//""Note - You have to create the directories first. Vim wont create them for you."Otherwise, you can just set vim to NOT have any of these. Just uncomment the"set directory/set backupdir/set undodir options above and comment the following.set nobackupset noswapfileset noundofile

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum