Last active
December 18, 2018 14:54
-
-
Save jhonasn/add126c8c00b727c1a021d9c19189500 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" no compatible with vi | |
set nocompatible | |
" color syntax | |
"syntax enable | |
" real colors | |
set termguicolors | |
" for netrw | |
filetype plugin on | |
" show number | |
set number | |
" show relative line number | |
set relativenumber | |
set cc=80 | |
" set default colorscheme | |
set background=dark | |
colorscheme kkruby | |
" search down files into subfolders | |
" with :find command | |
set path+=** | |
" ignore folders to run find quickly | |
" set wildignore+=node_modules/** | |
set wildignore+=**/node_modules/** | |
" set wildignore+=.git/** | |
set wildignore+=**/.git/** | |
" display all matching files when we tab complete | |
set wildmenu | |
" create the 'tags' file (depends on ctags. doesnt help if u want a visual list of tags | |
command! MakeTags !ctags --exclude=.git --exclude=node_modules --exclude=test -R . | |
" FILE BROWSING: | |
" | |
" Tweaks for browsing | |
let g:netrw_banner=0 " disable annoying banner | |
let g:netrw_browse_split=4 " open in prior window | |
let g:netrw_altv=1 " open splits to the right | |
let g:netrw_liststyle=3 " tree view | |
let g:netrw_list_hide=netrw_gitignore#Hide() | |
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+' | |
" Change directory to the current buffer when opening files. | |
set autochdir | |
" NOW WE CAN: | |
" - :edit a folder to open a file browser | |
" - <CR>/v/t to open in an h-split/v-split/tab | |
" - check |netrw-browse-maps| for more mappings | |
" Toggle Vexplore with Ctrl-E | |
fun! Lexplore(dir, right) | |
if exists("t:netrw_lexbufnr") | |
" close down netrw explorer window | |
let lexwinnr = bufwinnr(t:netrw_lexbufnr) | |
if lexwinnr != -1 | |
let curwin = winnr() | |
exe lexwinnr."wincmd w" | |
close | |
exe curwin."wincmd w" | |
endif | |
unlet t:netrw_lexbufnr | |
else | |
" open netrw explorer window in the dir of current file | |
" (even on remote files) | |
let path = substitute(exists("b:netrw_curdir")? b:netrw_curdir : expand("%:p"), '^\(.*[/\\]\)[^/\\]*$','\1','e') | |
exe (a:right? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new" | |
if a:dir != "" | |
exe "Explore ".a:dir | |
else | |
exe "Explore ".path | |
endif | |
setlocal winfixwidth | |
let t:netrw_lexbufnr = bufnr("%") | |
endif | |
endfun | |
map <silent> <C-E> :call Lexplore('%:p:h', 0)<CR> | |
" SNIPPETS: | |
" Read an empty HTML template and move cursor to title | |
nnoremap ,html :-1read $HOME/.vim/.skeleton.html<CR>3jwf>a | |
" NOW WE CAN: | |
" - Take over the world! | |
" (with much fewer keystrokes) | |
" BUILD INTEGRATION: | |
" Steal Mr. Bradley's formatter & add it to our spec_helper | |
" http://philipbradley.net/rspec-into-vim-with-quickfix | |
" Configure the `make` command to run RSpec | |
">> set makeprg=bundle\ exec\ rspec\ -f\ QuickfixFormatter | |
" NOW WE CAN: | |
" - Run :make to run RSpec | |
" - :cl to list errors | |
" - :cc# to jump to error by number | |
" - :cn and :cp to navigate forward and back | |
" set syntax to vue files | |
autocmd BufNew,BufRead *.vue set syntax=html | |
" per project .vimrc | |
set exrc | |
""" | |
" useful commands: (^ = ctrl) | |
" use :ls to view opened files | |
" use :b to search into opened files | |
" E, B to jump to de bounds of joined text | |
" 'change inside': | |
" ci[something like ", ', (, or {] to change inside two this characters | |
" 'change at': | |
" ca[something...] to change outer the thing | |
" | |
" TAG JUMPING: | |
" ^] to jump to tag under cursor | |
" g^] for ambiguous tags | |
" ^t to jump back up the tag stack | |
" | |
" AUTOCOMPLETE: | |
" | |
" The good stuff is documented in |ins-completion| | |
" HIGHLIGHTS: | |
" - ^x^n for JUST this file | |
" - ^x^f for filenames (works with our path trick!) | |
" - ^x^] for tags only | |
" - ^n for anything specified by the 'complete' option | |
" NOW WE CAN: | |
" - Use ^n and ^p to go back and forth in the suggestion list | |
""" | |
if has("gui_running") | |
GuiFont Monaco:h12 | |
endif | |
" teminal exit insert with ctrl+[ and esc | |
:tnoremap <C-[> <C-\><C-N> | |
:tnoremap <esc> <C-\><C-N> | |
" Change windows with alt + [h, j,k,l] | |
:tnoremap <A-h> <C-\><C-N><C-w>h | |
:tnoremap <A-j> <C-\><C-N><C-w>j | |
:tnoremap <A-k> <C-\><C-N><C-w>k | |
:tnoremap <A-l> <C-\><C-N><C-w>l | |
:inoremap <A-h> <C-\><C-N><C-w>h | |
:inoremap <A-j> <C-\><C-N><C-w>j | |
:inoremap <A-k> <C-\><C-N><C-w>k | |
:inoremap <A-l> <C-\><C-N><C-w>l | |
:nnoremap <A-h> <C-w>h | |
:nnoremap <A-j> <C-w>j | |
:nnoremap <A-k> <C-w>k | |
:nnoremap <A-l> <C-w>l | |
" open this file with command VimConfig | |
if has('linux') | |
command VimConfig e ~/.config/nvim/init.vim | |
command VimReload source ~/.config/nvim/init.vim | |
else | |
command VimConfig e $APPDATA/../Local/nvim/init.vim | |
command VimReload source $APPDATA/../Local/nvim/init.vim | |
endif | |
if empty(glob('~/.config/nvim/autoload/plug.vim')) | |
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
" Plugins: | |
call plug#begin('~/.config/nvim/plugged') | |
Plug 'vim-airline/vim-airline' | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'zchee/deoplete-jedi' | |
Plug 'neomake/neomake' | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'jiangmiao/auto-pairs' | |
"Plug 'SirVer/ultisnips' | |
"Plug 'vim-vdebug/vdebug' | |
call plug#end() | |
" Plugins config: | |
let g:deoplete#enable_at_startup = 1 | |
let g:deoplete#sources#jedi#show_docstring = 1 | |
let g:UltiSnipsEditSplit="vertical" | |
let g:UltiSnipsSnippetsDir = '~/.config/nvim/UltiSnips' | |
let g:neomake_open_list = 2 | |
call neomake#configure#automake('nrwi', 500) | |
:nnoremap <C-d> !python ~/.local/share/komodo-dbg/pydbgp -d localhost:9000 % | |
" mount my default style windows | |
function DefaultEnv() | |
vsplit | |
wincmd h | |
vertical resize 25 | |
edit . | |
wincmd l | |
split | |
wincmd j | |
resize 10 | |
terminal | |
wincmd k | |
endfunction | |
"autocmd VimEnter call DefaultEnv() | |
autocmd VimEnter * execute(':call DefaultEnv()') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment