initial commit
This commit is contained in:
217
config/nvim/init.vim
Normal file
217
config/nvim/init.vim
Normal file
@ -0,0 +1,217 @@
|
||||
"Many ideas from https://github.com/nicknisi/dotfiles/blob/master/config/nvim/init.vim
|
||||
"https://github.com/mhartington/dotfiles/blob/master/vimrc
|
||||
"and https://dougblack.io/words/a-good-vimrc.html
|
||||
|
||||
" Plugins
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
|
||||
Plug 'vim-airline/vim-airline' " fancy statusline
|
||||
Plug 'vim-airline/vim-airline-themes' " themes for vim-airline
|
||||
Plug 'scrooloose/nerdtree' " file tree browser
|
||||
Plug 'ctrlpvim/ctrlp.vim' " fuzzy file finder
|
||||
Plug 'bronson/vim-trailing-whitespace'
|
||||
Plug 'altercation/vim-colors-solarized'
|
||||
Plug 'ryanoasis/vim-devicons' " awesome icons
|
||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||
Plug 'ashisha/image.vim' " Display images in vim
|
||||
Plug 'Yggdroot/indentLine' " Display indent line
|
||||
Plug 'neomake/neomake' " asynchronous make functionality :NeoMake!
|
||||
Plug 'Shougo/deoplete.nvim' " autocomplete function
|
||||
"Plug 'Shougo/neocomplcache.vim'
|
||||
"Plug 'terryma/vim-multiple-cursors' "Sublime multiple cursor support
|
||||
Plug 'Shougo/neosnippet.vim' " snippet manager
|
||||
Plug 'Shougo/neosnippet-snippets' " default snippets
|
||||
Plug 'Raimondi/delimitMate' " automatic closing of quotes, parenthesis, brackets, etc.
|
||||
Plug 'tpope/vim-commentary' " comment stuff out
|
||||
Plug 'tpope/vim-ragtag' " endings for html, xml, etc. - ehances surround
|
||||
Plug 'tpope/vim-surround' " mappings to easily delete, change and add such
|
||||
Plug 'tpope/vim-fugitive' " Git support
|
||||
Plug 'airblade/vim-gitgutter' " show git diff in gutter
|
||||
" surroundings in pairs, such as quotes, parens, etc.
|
||||
Plug 'simnalamburt/vim-mundo' " undo tree visualizer DOESN'T WORK ATM
|
||||
"Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } " focus tool. Dim text. Good for presentating with vim
|
||||
|
||||
"language-specific plugins
|
||||
" html
|
||||
Plug 'gregsexton/MatchTag' "highlight the current tag
|
||||
|
||||
" latex
|
||||
Plug 'lervag/vimtex'
|
||||
|
||||
call plug#end()
|
||||
|
||||
" Theme
|
||||
syntax enable
|
||||
"set background=dark
|
||||
colorscheme solarized
|
||||
|
||||
if has('gui_running')
|
||||
set background=light
|
||||
else
|
||||
set background=dark
|
||||
endif
|
||||
|
||||
|
||||
" Enable snipMate compatibility feature.
|
||||
"let g:neosnippet#enable_snipmate_compatibility = 1
|
||||
"let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
|
||||
|
||||
"deoplete settings
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
let g:deoplete#ignore_sources = {}
|
||||
"let g:deoplete#ignore_sources._ = ["neosnippet"]
|
||||
|
||||
" I want to use my tab more smarter. If we are inside a completion menu jump
|
||||
" to the next item. Otherwise check if there is any snippet to expand, if yes
|
||||
" expand it. Also if inside a snippet and we need to jump tab jumps. If none
|
||||
" of the above matches we just call our usual 'tab'.
|
||||
function! s:neosnippet_complete()
|
||||
if pumvisible()
|
||||
return "\<c-n>"
|
||||
else
|
||||
if neosnippet#expandable_or_jumpable()
|
||||
return "\<Plug>(neosnippet_expand_or_jump)"
|
||||
endif
|
||||
return "\<tab>"
|
||||
endif
|
||||
endfunction
|
||||
imap <expr><TAB> <SID>neosnippet_complete()
|
||||
|
||||
:inoremap <lt>/ </<C-X><C-O>
|
||||
|
||||
" nerdtree setting
|
||||
" start with vim if no file is specified
|
||||
if has("autocmd")
|
||||
autocmd StdinReadPre * let s:std_in=1
|
||||
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
||||
" close vim if only nerd tree is open
|
||||
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
||||
endif
|
||||
map <C-n> :NERDTreeToggle<CR>
|
||||
|
||||
" Highlight full name (not only icons)
|
||||
let g:NERDTreeFileExtensionHighlightFullName = 1
|
||||
let g:NERDTreeExactMatchHighlightFullName = 1
|
||||
let g:NERDTreePatternMatchHighlightFullName = 1
|
||||
" Disable uncommon file extensions highlighting (good idea if lag when scrolling)
|
||||
let g:NERDTreeLimitedSyntax = 1
|
||||
" after a re-source, fix syntax matching issues (concealing brackets):
|
||||
if exists('g:loaded_webdevicons')
|
||||
call webdevicons#refresh()
|
||||
endif
|
||||
|
||||
" toggle gundo
|
||||
nnoremap <leader>u :MundoToggle<CR>
|
||||
|
||||
" Toggle number lines
|
||||
map <C-S-l> :set number!<CR>:set relativenumber!<CR>
|
||||
set relativenumber
|
||||
set number
|
||||
|
||||
set history=200 "set Ex command history
|
||||
set autoread " detect when a file is changed
|
||||
|
||||
set cursorline
|
||||
|
||||
" enable global undo
|
||||
set undofile
|
||||
set undodir=~/.config/nvim/undo
|
||||
|
||||
" jump to the last position when reopening a file
|
||||
if has("autocmd")
|
||||
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
||||
endif
|
||||
|
||||
set shortmess=I "disable intro message
|
||||
|
||||
" Tab control
|
||||
set expandtab " insert spaces rather than tabs for <Tab> [noexpandtab for invert]
|
||||
set smarttab " tab respects 'tabstop', 'shiftwidth', and 'softtabstop'
|
||||
set tabstop=2 " the visible width of tabs
|
||||
set softtabstop=2 " edit as if the tabs are 4 characters wide
|
||||
set shiftwidth=2 " number of spaces to use for indent and unindent
|
||||
set shiftround " round indent to a multiple of 'shiftwidth'
|
||||
set completeopt+=longest
|
||||
|
||||
" Vim Splits
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" substitute live preview
|
||||
set inccommand=nosplit
|
||||
|
||||
|
||||
" Key Bindings
|
||||
|
||||
"ReMap leader key
|
||||
let mapleader = ","
|
||||
|
||||
" for learning: disable arrow keys
|
||||
" noremap <Up> <NOP>
|
||||
" noremap <Down> <NOP>
|
||||
" noremap <Left> <NOP>
|
||||
" noremap <Right> <NOP>
|
||||
|
||||
" better movement in Vim Splits
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
" enable copy to clipboard
|
||||
map <Leader>y "+y
|
||||
map <Leader>p "*p
|
||||
|
||||
" move vertically by visual line
|
||||
" if there is a very long line that gets visually wrapped to two lines, wouldn't skip over the "fake" part of the visual line
|
||||
nnoremap <UP> gk
|
||||
nnoremap <DOWN> gj
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
|
||||
" fast movement
|
||||
nnoremap J 5j
|
||||
nnoremap K 5k
|
||||
|
||||
" cursor to begin or end of line
|
||||
nnoremap B ^
|
||||
nnoremap E $
|
||||
|
||||
" Align block of text and keep them selected
|
||||
vmap < <gv
|
||||
vmap > >gv
|
||||
|
||||
" Faster delete. Doesnt work actually
|
||||
inoremap <C-BS> db
|
||||
inoremap <C-Del> dw
|
||||
|
||||
" turn off last search highlight
|
||||
map <esc> :noh<cr>
|
||||
|
||||
" highlight last inserted text
|
||||
nnoremap gV `[v`]
|
||||
|
||||
" jk is escape
|
||||
inoremap jk <ESC>
|
||||
|
||||
call togglebg#map("<F5>") "Toggle background dark/light
|
||||
map <F6> :IndentLinesToggle<CR>
|
||||
|
||||
" vim-airline
|
||||
|
||||
let g:airline_theme='badwolf'
|
||||
let g:airline_left_sep = ''
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep = ''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_symbols_branch = ''
|
||||
let g:airline_symbols_readonly = ''
|
||||
let g:airline_symbols_linenr = ''
|
||||
let g:airline_powerline_fonts = 1 "required for devicons
|
||||
" Enable Airline Tabbar
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
|
||||
set encoding=utf8
|
||||
set guifont=DroidSansMonoForPowerline\ Nerd\ Font
|
||||
|
||||
" EOF
|
BIN
config/nvim/logo.png
Normal file
BIN
config/nvim/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 508 KiB |
12
config/nvim/neovim.desktop
Normal file
12
config/nvim/neovim.desktop
Normal file
@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Categories=Utility;TextEditor;
|
||||
Comment=Edit file in NeoVim
|
||||
Exec=nvim %f
|
||||
GenericName=Text Editor Vim
|
||||
Hidden=false
|
||||
Icon=/home/roman/.config/nvim/logo.png
|
||||
Name=NeoVim
|
||||
Terminal=true
|
||||
Type=Application
|
||||
Version=1.0
|
||||
|
Reference in New Issue
Block a user