Skip to content

Instantly share code, notes, and snippets.

@SeanFelipe
Last active April 25, 2021 17:11
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 SeanFelipe/8aa1ce4e293a6ae77b04101e95b64aa8 to your computer and use it in GitHub Desktop.
Save SeanFelipe/8aa1ce4e293a6ae77b04101e95b64aa8 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
"Plugin 'preservim/nerdtree'
Plugin 'sheerun/vim-wombat-scheme'
Plugin 'vim-airline/vim-airline'
"Plugin 'scrooloose/syntastic'
Plugin 'tikhomirov/vim-glsl'
Plugin 'yuezk/vim-js'
Plugin 'maxmellon/vim-jsx-pretty'
Plugin 'w0rp/ale'
" Plugin 'yannickcr/eslint-plugin-react'
Plugin 'pangloss/vim-javascript'
Plugin 'vim-crystal/vim-crystal'
Plugin 'udalov/kotlin-vim'
"Plugin 'Valloric/YouCompleteMe'
"Plugin 'ajh17/VimCompletesMe'
Plugin 'ruby-formatter/rufo-vim'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'habamax/vim-godot'
call vundle#end()
filetype plugin indent on
" airline tabs
"let g:airline#extensions#tabline#enabled = 1
"let g:airline#extensions#tabline#fnamemod = ':t'
" somehow this is required or ruby files load with about 2s latency (??)
let g:ruby_path = ''
let g:ale_sign_error = 'x'
let g:ale_sign_warning = '!'
"let g:ale_lint_delay = 0
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow
let g:ale_linters = {
\ 'javascript': ['jshint'],
\ 'ruby': ['ruby'],
\}
" Enable rufo (RUby FOrmat)
"let g:rufo_auto_formatting = 1
colorscheme wombat
syntax on
set autoindent
set expandtab
set laststatus=2
set shiftwidth=2
set noshowmode
set title
set titlestring=%t
set colorcolumn=0
" fix backspace not working in insert mode certain situations
set backspace=indent,eol,start
set clipboard=
set spelllang=en_us
" 1F1 this still needs work.
"set tabline=%!MyTabLine()
let mapleader = "`"
" trim trailing whitespace
autocmd BufWritePre * %s/\s\+$//e
" mappings
nmap { O{/*<Esc>
nmap } o*/}<Esc>
" tab stuffs - new, next, previous, open
nmap <C-a> :tabnew<Cr>
"nmap { gT
"nmap } gt
nmap + gt
nmap _ gT
nmap + gt
nmap T :tabe<Space>
" fuzzy file finder fzf, invoked by :Files after we create a new tab
nmap ; :tabnew<Cr>:Files<Cr>
"map ; :Files<CR>
nmap e $
nmap <C-=> <C-w>=
nmap <C-c> :color wombat<Cr>
nmap <C-e> <C-w><C-w>
nmap <C-g> :!<Space>ag<Space>
nmap <C-j> :wincmd j<Cr>
nmap <C-k> :wincmd k<Cr>
"nmap <C-n> :set nowrap
"nmap <C-p> :split<Cr>
" C-s seems to be gobbled up by the terminal
"nmap <C-l> :set spell<Cr>
nmap <C-l> :split<Cr>
nmap <C-o> <Esc>gt
nmap <C-p> <Esc>gT
nmap <C-t> :NERDTreeToggle<Cr>
nmap <C-v> :vsp<Cr>
nmap <C-\> :q<Cr>
" control bracket has some weird interactions w terminal
"nmap <C-[> Ofoo<Esc>
"nmap <C-]> Obar<Esc>
nmap J :w<Cr>
nmap % :%s/
nmap # -i#<Esc>
nmap - ^
nmap <S-i> i<Space><Esc>
"nmap 11 :set paste
"nmap 22 :set nopaste
nmap L O<Esc>
nmap K O<Esc>
vmap YY :w !pbcopy<CR><CR>
nmap <Tab> A
nmap e $
nmap ? -i//<Esc>
nmap S :source ~/.vimrc<Cr>
nmap & O{/*<Esc>
nmap * o*/}<Esc>
nmap ( O/*<Esc>
nmap ) o*/<Esc>
nmap <leader>c Oconstructor(props) {<Cr>super(props)<Cr>}<Esc>ko
nmap <leader>b oborder: 2px solid lightgrey;<Esc>
nmap <leader>d OcomponentDidMount() {<Cr>}<Cr><Esc>kO
nmap <leader>k irequire 'byebug'; alias :breakpoint :byebug<Cr><Esc>
nmap <leader>n :set nowrap<Cr>
nmap <leader>r oborder: 2px solid lightgrey;<Esc>
vmap e $
"vmap y :.!pbcopy<Cr>
imap jz <Esc>:w<Cr>
imap <C-a> <Esc>-i
imap <C-c> console.log("")<Esc>hi
"imap <C-d> <Esc>lC
imap <C-d> <Del>
imap <C-e> <Esc>A
imap <C-g> %>
imap <C-h> <Esc>bi
" C-i gets triggered by a double-tab
"imap <C-i> id=""<Esc>i
"imap <C-n> <Esc>ji
imap <C-j> JSON.stringify(<Esc>A)<Esc>
"imap <C-k> binding.pry
"imap <C-> className=""<Esc>i
imap <C-l> className=""<Esc>i
"imap <C-l> <Esc>li
"
" C-m interferes with <Cr>
"imap <C-m> <Esc>gT
imap <C-o> <Esc>gt
imap <C-p> <Esc>gT
imap <C-r> <Space>=<Space>()<Space>=><Space><C-o>
imap <C-t> style={}<Esc>i
"imap <C-u> <Esc>ui
imap <C-u> {<Cr>}<Esc>O
imap <C-v> <%
imap <C-x> <Del>
"imap <C-;> <Esc>wi
" C-[ causes lots of issues, screws up esc button
"imap <C-[>
"imap <C-,> foobar
"imap <C-,> foobar
" toggle paste mode automatically
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
" find files and populate the quickfix list
function! FindFiles(filename)
let error_file = tempname()
silent exe '!find . -name "'.a:filename.'" | xargs file | sed "s/:/:1:/" > '.error_file
set errorformat=%f:%l:%m
exe "cfile ". error_file
copen
call delete(error_file)
endfun
command! -nargs=1 FindFile call FindFiles(<q-args>)
autocmd FileType java setlocal shiftwidth=4 softtabstop=4 expandtab
augroup filetypedetect
au BufRead,BufNewFile Guardfile setfiletype ruby
au BufRead,BufNewFile Podfile setfiletype ruby
au BufRead,BufNewFile Gemfile setfiletype ruby
au BufRead,BufNewFile *.podspec setfiletype ruby
au BufRead,BufNewFile *.chizu setfiletype ruby
augroup END
"trim trailing whitespace
autocmd BufWritePre * %s/\s\+$//e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment