Skip to content

Commit

Permalink
nvim: Replace vim with nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
scizzorz committed Sep 14, 2020
1 parent e72b1a1 commit 551ce00
Show file tree
Hide file tree
Showing 70 changed files with 2,746 additions and 1,052 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/vim/.netrwhist
/alacritty.yml
/prompt.sh
/nvim/plugged
69 changes: 0 additions & 69 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,69 +0,0 @@
[submodule "vim/bundle/css"]
path = vim/bundle/css
url = https://github.com/JulesWang/css.vim
[submodule "vim/bundle/html5"]
path = vim/bundle/html5
url = https://github.com/othree/html5.vim
[submodule "vim/bundle/commentary"]
path = vim/bundle/commentary
url = https://github.com/tpope/vim-commentary
[submodule "vim/bundle/jinja"]
path = vim/bundle/jinja
url = https://github.com/mitsuhiko/vim-jinja
[submodule "vim/bundle/python-combined"]
path = vim/bundle/python-combined
url = https://github.com/mitsuhiko/vim-python-combined
[submodule "vim/bundle/markdown"]
path = vim/bundle/markdown
url = https://github.com/plasticboy/vim-markdown
[submodule "vim/bundle/surround"]
path = vim/bundle/surround
url = https://github.com/tpope/vim-surround
[submodule "vim/bundle/supertab"]
path = vim/bundle/supertab
url = https://github.com/ervandew/supertab
[submodule "vim/bundle/signature"]
path = vim/bundle/signature
url = https://github.com/kshenoy/vim-signature.git
[submodule "vim/bundle/minimap"]
path = vim/bundle/minimap
url = https://github.com/naddeoa/vim-visual-page-percent.git
[submodule "vim/bundle/glsl"]
path = vim/bundle/glsl
url = https://github.com/tikhomirov/vim-glsl.git
[submodule "vim/bundle/ack"]
path = vim/bundle/ack
url = https://github.com/mileszs/ack.vim.git
[submodule "vim/bundle/ale"]
path = vim/bundle/ale
url = https://github.com/w0rp/ale.git
[submodule "vim/bundle/youcompleteme"]
path = vim/bundle/youcompleteme
url = https://github.com/Valloric/YouCompleteMe.git
[submodule "vim/bundle/javascript"]
path = vim/bundle/javascript
url = https://github.com/pangloss/vim-javascript.git
[submodule "vim/bundle/rust"]
path = vim/bundle/rust
url = https://github.com/rust-lang/rust.vim.git
[submodule "vim/bundle/pico8"]
path = vim/bundle/pico8
url = https://github.com/justinj/vim-pico8-syntax
[submodule "vim/bundle/skim"]
path = vim/bundle/skim
url = https://github.com/lotabout/skim.vim
[submodule "vim/bundle/toml"]
path = vim/bundle/toml
url = https://github.com/cespare/vim-toml.git
[submodule "vim/bundle/terraform"]
path = vim/bundle/terraform
url = https://github.com/hashivim/vim-terraform.git
[submodule "vim/bundle/rdf"]
path = vim/bundle/rdf
url = https://github.com/niklasl/vim-rdf.git
[submodule "vim/bundle/pest"]
path = vim/bundle/pest
url = https://github.com/pest-parser/pest.vim
[submodule "vim/bundle/mold"]
path = vim/bundle/mold
url = https://github.com/xtfc/mold.vim.git
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ echo "Initializing git submodules..."
git submodule update --init --recursive

mkdir -p $TO/.config
mkdir -p $TO/.local/share/nvim/site/autoload

echo "Installing from $FROM to $TO"
inst $TO/.xinitrc $FROM/xinitrc
Expand All @@ -33,6 +34,8 @@ inst $TO/.vimrc $FROM/vimrc
inst $TO/.gtk-bookmarks $FROM/gtk-bookmarks
inst $TO/.xmodmap $FROM/xmodmap
inst $TO/.config/flake8 $FROM/flake8
inst $TO/.config/nvim $FROM/nvim
inst $TO/.local/share/nvim/site/autoload/plug.vim $FROM/nvim/plug.vim

echo "Installing $FROM/fonts/* as $TO/.fonts/*..."
mkdir -p $TO/.fonts
Expand Down
10 changes: 2 additions & 8 deletions vim/color.vim → nvim/color.vim
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
set background=dark
set t_Co=256
let python_highlight_all = 1
let c_gnu = 1

" largely yanked from my vim config without review
syntax on
if exists("syntax_on")
syntax reset
endif
syntax reset
hi clear

" non-syntax things
Expand Down
1 change: 1 addition & 0 deletions vim/fold.vim → nvim/fold.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
" largely yanked from my vim config without review
set foldcolumn=0 " show a fold column!
set foldtext=FoldText() " set the collapsed fold text
set foldmethod=indent " set automatic folding
Expand Down
73 changes: 73 additions & 0 deletions nvim/init.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
set number
set scrolloff=4
set expandtab
set tabstop=2
set shiftwidth=2
set shiftround
set list
set listchars=tab:\|\ ,trail:·

set statusline=%F%(\ %m%)\ %(\ %r%)%(\ %h%)%=%{&ft}

set fillchars=stl:\ ,stlnc:\ ,vert:\ ,diff:\ ,fold:\ " no trailing whitespace here

set wildignore+=*.dll
set wildignore+=*.o
set wildignore+=*.pyc
set wildignore+=*.bak
set wildignore+=*.exe
set wildignore+=*.jpg
set wildignore+=*.jpeg
set wildignore+=*.png

set colorcolumn=88

" automatically resize splits when the window is resized
autocmd VimResized * exe "normal! \<c-w>="

filetype plugin indent on

source ~/.config/nvim/map.vim
source ~/.config/nvim/color.vim
source ~/.config/nvim/fold.vim

call plug#begin("~/.config/nvim/plugged")

Plug 'JulesWang/css.vim'
Plug 'cespare/vim-toml'
Plug 'hashivim/vim-terraform'
Plug 'justinj/vim-pico8-syntax'
Plug 'kshenoy/vim-signature'
Plug 'lotabout/skim.vim'
Plug 'mileszs/ack.vim'
Plug 'mitsuhiko/vim-jinja'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'niklasl/vim-rdf'
Plug 'othree/html5.vim'
Plug 'pangloss/vim-javascript'
Plug 'pest-parser/pest.vim'
Plug 'plasticboy/vim-markdown'
Plug 'preservim/nerdtree'
Plug 'rust-lang/rust.vim'
Plug 'tpope/vim-surround'
Plug 'xtfc/mold.vim'

call plug#end()

" coc.nvim config
" https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources#use-tab-or-custom-key-for-trigger-completion
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction

inoremap <silent><expr> <Tab>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<Tab>" :
\ coc#refresh()
" NERDTree config
nmap <Leader>n :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDTreeDirArrowExpandable = ''
let g:NERDTreeDirArrowCollapsible = ''
6 changes: 0 additions & 6 deletions vim/map.vim → nvim/map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ nnoremap <Leader>s vip:sort<CR>
" remove all trailing whitespace
nnoremap <Leader><Space> :%s/\s\+$//<CR><C-o>
" run :!make
nnoremap <Leader>m :!make<CR>
" clear search
nnoremap <Leader>/ :let @/ = ""<CR>
Expand Down Expand Up @@ -73,9 +70,6 @@ nnoremap zv za
" recursive fold toggling
nnoremap zV zA
" simulate <Esc> (only useful on a non-full keyboard)
imap jj <Esc>
" reselect visual block after indent / outdent
vnoremap < <gv
vnoremap > >gv
Expand Down
Loading

0 comments on commit 551ce00

Please sign in to comment.