Skip to content

Instantly share code, notes, and snippets.

@stringsn88keys
Last active February 22, 2024 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stringsn88keys/7788242 to your computer and use it in GitHub Desktop.
Save stringsn88keys/7788242 to your computer and use it in GitHub Desktop.
My current .vimrc file
"let g:powerline_config_overrides={"common":{"log_file":"/tmp/powerline.log"}}
"
" :h feature-list for a list of features that are testable
if !has("win32")
set shell=/bin/zsh
endif
call plug#begin('~/vimfiles/plugged')
Plug 'https://github.com/bhrown/brown.vim.git'
"Plug 'https://github.com/github/copilot.vim.git'
Plug 'https://github.com/tpope/vim-speeddating.git'
Plug 'https://github.com/kien/ctrlp.vim'
Plug 'https://github.com/tpope/vim-rails.git'
Plug 'https://github.com/tpope/vim-abolish.git'
Plug 'https://github.com/tpope/vim-fugitive.git'
Plug 'https://github.com/rizzatti/dash.vim.git'
Plug 'https://github.com/wavded/vim-stylus.git'
Plug 'https://github.com/slim-template/vim-slim.git'
Plug 'https://github.com/rhysd/vim-crystal.git'
Plug 'https://github.com/mileszs/ack.vim.git'
Plug 'https://github.com/tpope/vim-cucumber.git'
Plug 'https://github.com/vim-scripts/AnsiEsc.vim.git'
Plug 'https://github.com/fatih/vim-go.git'
Plug 'https://github.com/astashov/vim-ruby-debugger.git'
Plug 'https://github.com/wakatime/vim-wakatime.git'
Plug 'https://github.com/pthrasher/conqueterm-vim.git'
Plug 'https://github.com/mattn/gist-vim'
Plug 'https://github.com/gregsexton/gitv'
Plug 'https://github.com/tomasr/molokai'
Plug 'https://github.com/elixir-lang/vim-elixir.git'
Plug 'https://github.com/juvenn/mustache.vim'
Plug 'https://github.com/Lokaltog/powerline'
Plug 'https://github.com/Lokaltog/powerline-fonts'
Plug 'https://github.com/jceb/vim-orgmode.git'
"" 'https://github.com/marcus/rsense.git'
"" 'https://github.com/vim-scripts/taglist.vim'
Plug 'https://github.com/tpope/vim-bundler'
Plug 'https://github.com/kchmck/vim-coffee-script'
Plug 'https://github.com/altercation/vim-colors-solarized'
Plug 'https://github.com/sickill/vim-pasta.git'
Plug 'https://github.com/effkay/argonaut.vim.git'
Plug 'https://github.com/tpope/vim-rake'
"" DEFER 'https://github.com/benmills/vimux'
Plug 'https://github.com/tpope/vim-pathogen.git'
Plug 'https://github.com/ervandew/supertab.git'
Plug 'https://github.com/godlygeek/tabular.git'
Plug 'https://github.com/hallison/vim-rdoc.git'
"" 'https://github.com/msanders/snipmate.vim.git'
Plug 'https://github.com/pangloss/vim-javascript.git'
Plug 'https://github.com/scrooloose/nerdtree.git'
Plug 'https://github.com/timcharper/textile.vim.git'
Plug 'https://github.com/tpope/vim-git.git'
Plug 'https://github.com/tpope/vim-haml.git'
Plug 'https://github.com/tpope/vim-markdown.git'
Plug 'https://github.com/tpope/vim-repeat.git'
Plug 'https://github.com/tpope/vim-surround.git'
Plug 'https://github.com/tpope/vim-vividchalk.git'
Plug 'https://github.com/davidoc/taskpaper.vim.git'
Plug 'https://github.com/tmhedberg/matchit.git'
" Plug 'https://github.com/tsaleh/vim-shoulda.git'
"" 'https://github.com/tsaleh/vim-tcomment.git'
"Plug 'https://github.com/tsaleh/vim-tmux.git'
Plug 'https://github.com/vim-ruby/vim-ruby.git'
Plug 'https://github.com/vim-scripts/Gist.vim.git'
Plug 'https://github.com/vim-scripts/paredit.vim.git'
Plug 'https://github.com/vim-scripts/Colour-Sampler-Pack.git'
Plug 'https://github.com/stephenmckinney/vim-solarized-powerline.git'
Plug 'https://github.com/cespare/vim-toml'
call plug#end()
"
colors candycode
" colors borland
" colors vividchalk
" colors tango
" colors brookstream
" colors chocolateliquor
" colors candycode
" colors nightshimmer
" colors liquidcarbon
" let g:colors_name='wombat256mod'
"colors colors_name
" colors railscasts2
"colors intellij
" colors blue
" colors koehler
set ts=2
set sw=2
set et
set nu
set noswapfile
set encoding=utf-8
command WQ wq
command Wq wq
command W w
command Q q
"autocmd!
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
set autochdir
au BufNewFile,BufRead *.markerb set filetype=markdown
au! BufNewFile,BufRead *.applescript setf applescript
au Syntax prawn setf ruby
au BufNewFile,BufRead *.casper set filetype=ruby
au BufNewFile,BufRead *.casperPDF set filetype=ruby
au FileType ruby setlocal foldmethod=syntax nofoldenable
au FileType xml setlocal foldmethod=syntax nofoldenable
" via http://ku1ik.com/2011/09/08/formatting-xml-in-vim-with-indent-command.html
" reformat xml with gg=G in normal/command mode
au FileType xml setlocal equalprg=xmllint\ --format\ --recover\ -\ 2>/dev/null
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
if &ft =~ 'markdown'
return
endif
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" Resize the current split to at least (90,25) but no more than (140,60)
" or 2/3 of the available space otherwise.
function! Splitresize()
let hmax = max([winwidth(0), float2nr(&columns*1.0/tabpagewinnr(h:), 90])
let vmax = max([winheight(0), float2nr(&lines*0.50), 25])
exe "vertical resize" . (min([hmax, 140]))
exe "resize" . (min([vmax, 60]))
endfunction
com! -nargs=+ -complete=command Splitresize call Splitresize()
function! WinDo(command)
let currwin=winnr()
execute 'windo ' . a:command
execute currwin . 'wincmd w'
endfunction
com! -nargs=+ -complete=command Windo call WinDo(<q-args>)
set laststatus=2
set guifont=Ubuntu:h11
" Droid was the original
set guifont=Droid\ Sans\ Mono\ for\ Powerline:h12
set guifont=Inconsolata\ for\ Powerline:h12
set guifont=Ubuntu\ Mono\ derivative\ Powerline:h15
if has("macunix")
set macligatures
endif
set guifont=Fira\ Code:h14
" set guifont=Iosevka-Term:h14
set statusline=%t[%{strlen(&fenc)?&fenc:'none'},%{&ff}]%h%m%r%y%=%c,%l/%L\ %P
command! -bar -range=% NotRocket execute '<line1>,<line2>s/:\(\w\+\)\s*=>/\1:/e' . (&gdefault ? '' : 'g')
command! -bar -range=% Hashify execute '<line1>,<line2>s/\.\(\w\+\)\(\W*\)/[:\1]\2/e' . (&gdefault ? '' : 'g')
let @1='ciw`"`'
let @2='ciw"""'
" toggle nerdtree like split drawer vim
if has("macunix")
nmap <D-D> :NERDTreeToggle<cr>
imap <D-D> <ESC>:NERDTreeToggle<cr>
else
nmap <C-D> :NERDTreeToggle<cr>
imap <C-D> <ESC>:NERDTreeToggle<cr>
endif
" control-<direction command> navigates splits
nmap <C-j> j
nmap <C-k> k
nmap <C-l> l
nmap <C-h> h
let g:ctrlp_working_path_mode = 'ra'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.log
" use \\y to copy the current visual selection
let mapleader="\\"
vnoremap <leader><leader>y y:call system('pbcopy', @0)<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment