Skip to main content

Linux - vim - Useful vimrc


"set line numbers
" set number


noremap :n
noremap :N


set autoindent
set cindent
set smartindent
set formatoptions=tcroqn " see help
set incsearch
set ignorecase
set smartcase


nnoremap :set invpaste paste?
set pastetoggle=
set showmode


" Xml Alignment
map :1,$!xmllint --format -


"background
"set bg=dark
set bg=light


"Auto close braces...
"inoremap {      {}
"inoremap {  {}O
"inoremap {{     {
"inoremap {}     {}


"to map any key to do a repeated action
map %s/LOG_DEBUG/LOG_INFO/g


"nmap :tabnext


nmap :tabprev
nmap :tabnext


"highlight OverLength ctermbg=darkred ctermfg=white guibg=#FFD9D9 guifg=#FFFFFF
"match OverLength /\%81v.*/


"control number of spaces for a tab
set tabstop=4


" makes the spaces feel like real tabs
set softtabstop=4


"change the number of space characters for indentation
set shiftwidth=4


"put spaces instead of tabs
set expandtab


"Taglist plugin
nnoremap :TlistToggle
"let Tlist_Auto_Open = 1           " automatically open taglist for all files
let Tlist_Exit_OnlyWindow = 1     " exit if taglist is last window open
let Tlist_Show_One_File = 1       " Only show tags for current buffer
let Tlist_Enable_Fold_Column = 0  " no fold column (only showing one file)


"To turn off expandtab for editing makefiles
autocmd FileType make setlocal noexpandtab


"Everytime the user issue a :w command, Vim will automatically remove all
"trailing whitespace before saving.
"autocmd BufWritePre * :%s/\s\+$//e


"find trailing spaces
map /\s\+$
"remove trailing spaces
map :%s/\s\+$//e


"change all existing tabs to current tab settings
"retab


"show tabs and spaces
"se invlist


" Turn on wild menu which shows auto-complete options in the command mode
set wildmenu


" Minimal number of screen lines to keep above and below the cursor.
set scrolloff=3


" Always show the status line
set laststatus=1


" Allow using the mouse everywhere.
"set mouse=a
"set mouse=v
"set mouse=                      " disable mouse support in all modes
set mousehide                   " hide the mouse when typing text


" ,p and shift-insert will paste the X buffer, even on the command line
"nmap p i
"imap
"cmap


set winheight=999


set tags=/home/kik/tags


"Automatically put c, cpp headers while creating new files
"autocmd BufNewFile *.c r ~/.vim/cppheader
autocmd BufNewFile *.cpp r ~/.vim/cppheader


"filetype plugin on

Comments

Popular posts from this blog

Start with flask

1. Install python 2. Python comes with pip. Else install pip 3. pip install Flask 4. Create a file flaskFirst.py from flask import Flask app = Flask(__name__) @app.route('/') def index():     return 'Index Page' 3. Go to the path where the flaskFirst.py is present 4. export FLASK_APP=flaskFirst.py 5. flask run

Save Widows remote desktop credentials

First, START > All Programs > Accessories > Remote Desktop Connection Type in the computer name and clock OPTIONS Check off the box that says save credentials Now connect, and you will be prompted for your username/password. Enter them. Now you should be connected to the remote computer. Close out of the remote session. Method 1 Create a .bat file that has the following command: START mstsc.exe /v: & exit Run the .bat file and the remote desktop session should open and submit your saved credetials automatically. Method 2 Type mstsc -v it will login without asking credentials. Method 3 Save the session as a .rdp file (e.g: myRemoteMachine.rdp) and Double click the rdp file to open the remote desktop session without asking for credentials.