From 805ff97a2c69598b16b25b8101c04bcaa77d2cc2 Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Mon, 25 Feb 2019 12:14:54 -0700 Subject: [PATCH] Update dot files for neovim --- .bash_aliases | 4 +- .config/nvim/init.vim | 285 ++++++++++++++++++++++++++++++++++++++++++ .profile | 2 + .tmux.conf | 4 + .vimrc | 4 +- backup.sh | 1 + deploy.sh | 1 + 7 files changed, 297 insertions(+), 4 deletions(-) create mode 100644 .config/nvim/init.vim diff --git a/.bash_aliases b/.bash_aliases index d83b959..406fc3f 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -1,5 +1,5 @@ export PATH=/usr/lib/dart/bin:$HOME/.local/bin:/snap/bin:/usr/local/gradle/gradle-4.6/bin:/usr/local/kotlinc/bin:/usr/local/android-studio/bin:$HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/sbin:/local/bin:/usr/local/bin:/sbin:/usr/games:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/opt/android-sdk -export PATH=$PATH:$HOME/yuzu/:$HOME/Nim/bin:$HOME/.nimble/bin:$HOME/nimlibs +export PATH=$PATH:$HOME/.cargo/bin:$HOME/yuzu/:$HOME/.nimble/bin:$HOME/nimlibs export PATH=$PATH:$HOME/gcclibs/aarch64-linux-gnu/bin:$HOME/gcclibs/arm-linux-gnueabi/bin export PATH=$HOME/android-studio/bin:$HOME/.pub-cache/bin:$HOME/flutter/bin:$PATH export LD_LIBRARY_PATH=$HOME/Qt/5.12.0/gcc_64/lib:$LD_LIBRARY_PATH @@ -13,7 +13,7 @@ export DEVKITA64=${DEVKITPRO}/devkitA64 export PATH=$PATH:$DEVKITA64/bin:$DEVKITPRO/tools/bin export JAVA_HOME=/usr/lib/jvm/default-java export PATH=$HOME/.opam/4.05.0/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:$PATH -export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/lib:/usr/lib:/usr/local/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu" +export LD_LIBRARY_PATH="$HOME/Qt/5.12.0/gcc_64/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH:/lib:/usr/lib:/usr/local/lib:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu" export LFS=/mnt/lfs export PYTHONSTARTUP="$HOME/.pythonstartup" export ANT_OPTS="-Xmx1024m -XX:MaxPermSize=256m" diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..d68b737 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,285 @@ +map [1;5A +map [1;5B +map [1;5C +map [1;5D + +let mapleader = "\" +let maplocalleader = "\" + +let g:syntastic_c_compiler_options = "-std=c99" + +inoremap vmark ✓ + +augroup Binary + au! + au BufReadPre *.bin let &bin=1 + au BufReadPost *.bin if &bin | %!xxd + au BufReadPost *.bin set ft=xxd | endif + au BufWritePre *.bin if &bin | %!xxd -r + au BufWritePre *.bin endif + au BufWritePost *.bin if &bin | %!xxd + au BufWritePost *.bin set nomod | endif +augroup END + +set wildmenu +set wildmode=full +set shell=/bin/bash\ --login +set smartindent +set ruler +set t_Co=256 + +set backspace=2 +set autowrite + +set smarttab + +set expandtab +set nocompatible +set history=10000 +set foldmethod=indent +set foldlevel=99 +let g:pydiction_location='/home/joey/.vim/bundle/pydiction/complete-dict' +let g:python_version_2 = 1 +let g:jsx_ext_required = 0 +let g:asyncrun_auto = "make" +let g:syntastic_enable_elixir_checker = 1 +let g:syntastic_elixir_checkers = ['elixir'] +let g:LargeFile = 20 +"set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/ +set laststatus=2 +let g:airline_powerline_fonts = 1 +let g:airline_section_x = '' +let g:airline_section_y = '' + + +set undofile " Save undo's after file closes +set undodir=$HOME/.vim/undo " where to save undo histories +set undolevels=10000 +set undoreload=10000 " number of lines to save for undo +filetype plugin indent on +set pastetoggle= +set incsearch +set guicursor= + +let $NVIM_TUI_ENABLE_CURSOR_SHAPE = 0 + +set mouse=a +set tabstop=4 +set shiftwidth=4 + +"set statusline+=%{SyntasticStatuslineFlag()} +"set statusline+=%* + +let g:syntastic_check_on_wq = 0 +let g:python_highlight_space_errors = 0 +let g:jsx_ext_required = 0 +"let g:airline#extensions#tabline#enabled = 1 + +autocmd Filetype javascript setlocal ts=2 sw=2 expandtab + +map :NERDTreeTabsToggle +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +let g:NERDTreeDirArrowExpandable = '▸' +let g:NERDTreeDirArrowCollapsible = '▾' +autocmd Filetype nim setlocal ts=2 sts=2 sw=2 expandtab +autocmd Filetype less setlocal ts=2 sts=2 sw=2 expandtab +autocmd Filetype css setlocal ts=2 sts=2 sw=2 expandtab +let g:syntastic_javascript_checkers = ['eslint', 'flow'] + +let g:neoformat_javascript_prettier = { + \ 'exe': 'prettier', + \ 'args': ['--single-quote', '--trailing-comma all'], + \ } + +let g:toggleJSFormat = 0 +function! ToggleJSFormat(...) + if a:0 == 1 "toggle behaviour + let g:toggleJSFormat = 1 - g:toggleJSFormat + endif + + if g:toggleJSFormat == 0 "normal action, do the hi + autocmd! + autocmd BufWritePre *.js Neoformat + autocmd BufWritePre *.jsx Neoformat + else + autocmd! + autocmd BufWritePre *.js "" + autocmd BufWritePre *.jsx "" + endif +endfunction + +map :call ToggleJSFormat(1) +call ToggleJSFormat() + +" autocmd BufNew * if winnr('$') == 1 | tabmove99 | endif + +set hlsearch +highlight Search ctermbg=blue ctermfg=white guibg=blue + +filetype on +:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen + +highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen +highlight OverLength ctermbg=red ctermfg=black guibg=darkred + +highlight ALEError ctermfg=black ctermbg=red guifg=black guibg=red + +au! FileType python setl nosmartindent +au BufRead,BufNewFile *.py,*.js,*.jsx,*.nim,*.ml,*.mli match OverLength /\%89v.\+/ +au BufRead,BufNewFile *.py,*.js,*.jsx,*.nim,*.ml,*.mli 2match ExtraWhiteSpace /\s\+$\|\t/ +au StdinReadPost * set buftype=nofile +syntax on + +command C let @/="" +command CC :%s#_\(\l\)#\u\1#g +command U :%s#\C\(\<\u[a-z0-9]\+\|[a-z0-9]\+\)\(\u\)#\l\1_\l\2#g + +nmap =j :%!python -m json.tool + +if !exists("autocommands_loaded") + let autocommands_loaded = 1 + autocmd BufRead,BufNewFile,FileReadPost *.py source ~/.vim/python +endif +au BufRead,BufNewFile *.shpaml setfiletype shpaml + +nnoremap :let _s=@/:%s/\s\+$//e:let @/=_s:nohl + +" This beauty remembers where you were the last time you edited the file, and returns to the same position. +au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif +au BufRead,BufNewFile *.sass set filetype=sass + +map :mksession! ~/.vim_session +map :source ~/.vim_session + +" delete without yanking +nnoremap d "_d +vnoremap d "_d + +" Bubble single lines +nmap [e +nmap ]e +" Bubble multiple lines +vmap [egv +vmap ]egv + +" make escape key not delay +set timeoutlen=1000 ttimeoutlen=0 + +" nmap [e +" nmap ]e +vmap [egv +vmap ]egv + +vnoremap # :s#^#\## +vnoremap -# :s#^\### + +fun! JumpToDef() + if exists("*GotoDefinition_" . &filetype) + call GotoDefinition_{&filetype}() + else + exe "norm! \" + endif +endf + +" Jump to tag +nn :call JumpToDef() +ino :call JumpToDef()i + +autocmd FileType ocaml nmap :MerlinTypeOf + +" replace currently selected text with default register +" without yanking it +vnoremap p "_dP +let g:ycm_autoclose_preview_window_after_completion = 1 +let g:ycm_min_num_of_chars_for_completion = 99 +let g:flow#enable = 0 + +command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ + +let g:ctrlp_custom_ignore = { + \ 'dir': '\v[\/](\.git|node_modules|nimcache|\.sass-cache|bower_components|build|dist)$', + \ 'file': '\v\.(exe|so|dll|o)$', + \ 'link': '', + \ } +let g:ctrlp_prompt_mappings = { + \ 'AcceptSelection("e")': [''], + \ 'AcceptSelection("t")': ['', '<2-LeftMouse>'], + \ } + + +noremap :tabr +noremap :tabl +noremap gT +noremap gt + +inoremap :tabri +inoremap :tabli +inoremap gTi +inoremap gti + + +"set statusline+=%#warningmsg# +"set statusline+=%{SyntasticStatuslineFlag()} +"set statusline+=%* + +"let g:syntastic_always_populate_loc_list = 1 +"let g:syntastic_auto_loc_list = 1 +"let g:syntastic_check_on_wq = 0 + +call plug#begin('~/.local/share/nvim/plugged') +Plug 'zah/nim.vim' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-unimpaired' +Plug 'scrooloose/nerdtree' +Plug 'hynek/vim-python-pep8-indent' +Plug 'pangloss/vim-javascript' +Plug 'Glench/Vim-Jinja2-Syntax' +Plug 'tpope/vim-haml' +Plug 'hdima/python-syntax' +Plug 'hail2u/vim-css3-syntax' +Plug 'mxw/vim-jsx' +Plug 'ryanoasis/vim-devicons' +Plug 'tiagofumo/vim-nerdtree-syntax-highlight' +Plug 'jistr/vim-nerdtree-tabs' +Plug 'mustache/vim-mustache-handlebars' +Plug 'vim-scripts/errormarker.vim' +Plug 'elixir-lang/vim-elixir' +Plug 'jreybert/vim-largefile' +Plug 'sbdchd/neoformat' +Plug 'tpope/vim-obsession' +Plug 'dhruvasagar/vim-prosession' +Plug 'tmux-plugins/vim-tmux-focus-events' +Plug 'vim-airline/vim-airline' +Plug 'vim-airline/vim-airline-themes' +" Plug 'vim-syntastic/syntastic' +"Plug 'itchyny/lightline.vim' +Plug 'morhetz/gruvbox' +Plug 'tpope/vim-commentary' +Plug 'w0rp/ale' +Plug 'ctrlpvim/ctrlp.vim' +Plug 'udalov/kotlin-vim' +Plug 'ervandew/supertab' +Plug 'simnalamburt/vim-mundo' +Plug 'christoomey/vim-tmux-navigator' +Plug 'tpope/vim-surround' +Plug 'rakr/vim-one' +"Plug 'baabelfish/nvim-nim' +call plug#end() + +let $NVIM_TUI_ENABLE_TRUE_COLOR=1 +set termguicolors + +nnoremap :MundoToggle + +"let base16colorspace=256 +" set background=dark +"colorscheme base16-default-dark +" ## added by OPAM user-setup for vim / base ## 93ee63e278bdfc07d1139a748ed3fff2 ## you can edit, but keep this line +let g:airline_theme='one' +set background=dark +colorscheme one + +hi Normal ctermbg=none guibg=none +hi NonText ctermbg=none guibg=none +hi CursorLine cterm=NONE ctermbg=black ctermfg=NONE +set noshowmode diff --git a/.profile b/.profile index 1ffc865..e112bc5 100644 --- a/.profile +++ b/.profile @@ -26,3 +26,5 @@ if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi #xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape' + +export PATH="$HOME/.cargo/bin:$PATH" diff --git a/.tmux.conf b/.tmux.conf index 033e2eb..a581f8f 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -8,6 +8,10 @@ # -- general ------------------------------------------------------------------- +# Add truecolor support +set-option -ga terminal-overrides ",xterm-256color:Tc" +# Default terminal is 256 colors +set -g default-terminal "screen-256color" set -g default-terminal "screen-256color" # colors! setw -g xterm-keys on diff --git a/.vimrc b/.vimrc index 4bb93a2..b95cbd6 100644 --- a/.vimrc +++ b/.vimrc @@ -4,6 +4,7 @@ map [1;5C map [1;5D let mapleader = "\" +let maplocalleader = "\" let g:syntastic_c_compiler_options = "-std=c99" @@ -252,7 +253,6 @@ Plug 'jistr/vim-nerdtree-tabs' Plug 'mustache/vim-mustache-handlebars' Plug 'vim-scripts/errormarker.vim' Plug 'elixir-lang/vim-elixir' -Plug 'dag/vim-fish' Plug 'jreybert/vim-largefile' Plug 'sbdchd/neoformat' Plug 'tpope/vim-obsession' @@ -266,7 +266,7 @@ Plug 'morhetz/gruvbox' Plug 'tpope/vim-commentary' Plug 'chriskempson/base16-vim' Plug 'w0rp/ale' -Plug 'kien/ctrlp.vim' +Plug 'ctrlpvim/ctrlp.vim' Plug 'udalov/kotlin-vim' Plug 'ervandew/supertab' Plug 'simnalamburt/vim-mundo' diff --git a/backup.sh b/backup.sh index cb226e9..fea881a 100755 --- a/backup.sh +++ b/backup.sh @@ -1 +1,2 @@ cp -rf ~/.inputrc ~/.vim* ~/.python* ~/.bash* ~/bashscripts ~/.pylint* ~/.tmux* ~/.profile ~/.gitconfig . +cp -rf ~/.config/nvim .config/ diff --git a/deploy.sh b/deploy.sh index 67178ee..69e0c30 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1 +1,2 @@ cp -rf .inputrc .vim* .python* .bash* bashscripts .pylint* .tmux* .profile .gitconfig ~/ +cp -rf .config/* ~/.config/