Skip to content

Instantly share code, notes, and snippets.

@thirdreplicator
Created April 19, 2014 21:53
Show Gist options
  • Save thirdreplicator/11098644 to your computer and use it in GitHub Desktop.
Save thirdreplicator/11098644 to your computer and use it in GitHub Desktop.
my .vimrc file
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|target'
call pathogen#infect()
call pathogen#helptags()
set nocompatible
filetype on
filetype plugin on
syntax on
" ****
" **** TAB-related
" ****
set autoindent
set tabstop=2
set shiftwidth=2
" *** Remove trailing white spaces with one key stroke!
nmap _ :%s/\s\+$//<CR>:w<CR>
" *** Retab with one key stroke!nmap - :retab!<CR>:w<CR>
highlight ExtraWhitespace ctermbg=red guibg=blue
" --- DON'T need to change above when switching between spaces and tabs.
"
" STEP 1.
" Use TABS (not spaces).
set noexpandtab
" Use spaces NOT TABS.
"set expandtab
" STEP 2.
" *** Highlight trailing spaces & TABS in the beginning of the line.
"match ExtraWhitespace /\s\+$\|^ \+/
" *** Highlight trailing spaces & SPACES in the beginning of the line.
match ExtraWhitespace /\s\+$\|^ \+/
set number
set smartcase
set statusline=%<%f\%h%m%r%=%-20.(\ \ line=%l\ \ col=%c%V\ \ totlin=%L%)\ \ \%h%
m%r%=%-40(bytval=0x%B,%n%Y%)\%P
set noautoindent
set nocindent
set hlsearch
function Send_to_Screen(text)
if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
call Screen_Vars()
end
echo system("screen -S " . g:screen_sessionname . " -p " . g:screen_windowname . " -X stuff '" . substitute(a:text, "'", "'\\\\''", 'g') . "'")
endfunction
function Screen_Session_Names(A,L,P)
return system("screen -ls | awk '/Attached/ {print $1}'")
endfunction
function Screen_Vars()
if !exists("g:screen_sessionname") || !exists("g:screen_windowname")
let g:screen_sessionname = ""
let g:screen_windowname = "0"
end
let g:screen_sessionname = input("session name: ", "", "custom,Screen_Session_Names")
let g:screen_windowname = input("window name: ", g:screen_windowname)
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vmap <C-c><C-c> "ry :call Send_to_Screen(@r)<CR>
nmap <C-c><C-c> vip<C-c><C-c>
nmap <C-c>v :call Screen_Vars()<CR>
set laststatus=2
syn match WhiteSpace / / containedin=ALL conceal cchar=Æ
setl conceallevel=2 concealcursor=nv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment