Add nvim
This commit is contained in:
parent
9242964a1b
commit
cbae53227d
5
.config/nvim/.netrwhist
Normal file
5
.config/nvim/.netrwhist
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
let g:netrw_dirhistmax =10
|
||||||
|
let g:netrw_dirhistcnt =3
|
||||||
|
let g:netrw_dirhist_3='/home/templis/.config/nvim'
|
||||||
|
let g:netrw_dirhist_2='/home/templis/.config/i3'
|
||||||
|
let g:netrw_dirhist_1='/home/templis/.config/termite'
|
2597
.config/nvim/autoload/plug.vim
Normal file
2597
.config/nvim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load Diff
2509
.config/nvim/autoload/plug.vim.old
Normal file
2509
.config/nvim/autoload/plug.vim.old
Normal file
File diff suppressed because it is too large
Load Diff
283
.config/nvim/init.vim
Normal file
283
.config/nvim/init.vim
Normal file
@ -0,0 +1,283 @@
|
|||||||
|
call plug#begin('~/.config/nvim/plugged')
|
||||||
|
|
||||||
|
" Plugins {
|
||||||
|
" ctrl-p is a fuzzy file finder.
|
||||||
|
Plug 'kien/ctrlp.vim'
|
||||||
|
" airline is a better status line and a tab-bar for nvim.
|
||||||
|
Plug 'bling/vim-airline'
|
||||||
|
" gruvbox colorscheme. Seems to work the best for me.
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
|
" neomake is a code linting tool that runs in the background.
|
||||||
|
Plug 'neomake/neomake'
|
||||||
|
"autocompletion Plugin for Code autocomplete
|
||||||
|
Plug 'zchee/deoplete-jedi'
|
||||||
|
" Left side File Tree
|
||||||
|
"Plug 'scrooloose/nerdtree'
|
||||||
|
" install with nvim +PlugInstall +qall
|
||||||
|
" update with nvim +PlugUpgrade +PlugUpdate +PlugClean +qall
|
||||||
|
" you can also update it in nvim with syntax autocompletion and stuff - simply
|
||||||
|
" call PlugUpdate as an example
|
||||||
|
" }
|
||||||
|
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
" Map the leader key to ,
|
||||||
|
let mapleader="\<SPACE>"
|
||||||
|
|
||||||
|
" General {
|
||||||
|
set noautoindent " I indent my code myself.
|
||||||
|
set nocindent " I indent my code myself.
|
||||||
|
"set smartindent " Or I let the smartindent take care of it.
|
||||||
|
set breakindent " Indent line-breaks at the same level as code.
|
||||||
|
set ttimeoutlen=100
|
||||||
|
set fileencoding=utf-8
|
||||||
|
set fileencodings=utf-8,gbk,chinese,cp936,gb18030,utf-16le,utf-16,big5,euc-jp,euc-kr,latin-1
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Search {
|
||||||
|
set ignorecase " Make searching case insensitive
|
||||||
|
set smartcase " ... unless the query has capital letters.
|
||||||
|
set gdefault " Use 'g' flag by default with :s/foo/bar/.
|
||||||
|
|
||||||
|
" Use <C-L> to clear the highlighting of :set hlsearch.
|
||||||
|
if maparg('<C-L>', 'n') ==# ''
|
||||||
|
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
|
||||||
|
endif
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Spellcorrection {
|
||||||
|
setlocal spell spelllang=en_us
|
||||||
|
"setlocal spell spelllang=de_20
|
||||||
|
map <F7> :setlocal spell spelllang=de_20 <return>
|
||||||
|
map <F8> :setlocal spell spelllang=en_us <return>
|
||||||
|
map <F9> :w!<CR>:!aspell check %<CR>:e! %<CR>
|
||||||
|
|
||||||
|
|
||||||
|
" Formatting {
|
||||||
|
set showmatch " Show matching brackets.
|
||||||
|
set number relativenumber " Show the line numbers on the left side.
|
||||||
|
set formatoptions+=o " Continue comment marker in new lines.
|
||||||
|
set expandtab " Insert spaces when TAB is pressed.
|
||||||
|
set tabstop=4 " Render TABs using this many spaces.
|
||||||
|
set shiftwidth=4 " Indentation amount for < and > commands.
|
||||||
|
|
||||||
|
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
|
||||||
|
|
||||||
|
" More natural splits
|
||||||
|
set splitbelow " Horizontal split below current.
|
||||||
|
set splitright " Vertical split to right of current.
|
||||||
|
|
||||||
|
if !&scrolloff
|
||||||
|
set scrolloff=3 " Show next 3 lines while scrolling.
|
||||||
|
endif
|
||||||
|
if !&sidescrolloff
|
||||||
|
set sidescrolloff=5 " Show next 5 columns while side-scrolling.
|
||||||
|
endif
|
||||||
|
set nostartofline " Do not jump to first character with page commands.
|
||||||
|
|
||||||
|
" Tell Vim which characters to show for expanded TABs,
|
||||||
|
" trailing whitespace, and end-of-lines. VERY useful!
|
||||||
|
if &listchars ==# 'eol:$'
|
||||||
|
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
|
||||||
|
endif
|
||||||
|
set list " Show problematic characters.
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Configuration {
|
||||||
|
set autochdir " Switch to current file's parent directory.
|
||||||
|
|
||||||
|
" Remove special characters for filename
|
||||||
|
set isfname-=:
|
||||||
|
set isfname-==
|
||||||
|
set isfname-=+
|
||||||
|
|
||||||
|
" Map ; to :
|
||||||
|
nnoremap ; :
|
||||||
|
|
||||||
|
" Path/file expansion in colon-mode.
|
||||||
|
set wildmode=list:longest
|
||||||
|
|
||||||
|
" Allow color schemes to do bright colors without forcing bold.
|
||||||
|
if &t_Co == 8 && $TERM !~# '^linux'
|
||||||
|
set t_Co=16
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Remove trailing spaces.
|
||||||
|
function! TrimWhitespace()
|
||||||
|
let l:save = winsaveview()
|
||||||
|
%s/\s\+$//e
|
||||||
|
call winrestview(l:save)
|
||||||
|
endfunction
|
||||||
|
" FIXME: Do not call this on makefile and sv files.
|
||||||
|
autocmd BufWritePre * call TrimWhitespace()
|
||||||
|
nnoremap <leader>W :call TrimWhitespace()<CR>
|
||||||
|
|
||||||
|
" Diff options
|
||||||
|
set diffopt+=iwhite
|
||||||
|
|
||||||
|
"Enter to go to EOF and backspace to go to start
|
||||||
|
"nnoremap <CR> G
|
||||||
|
"nnoremap <BS> gg
|
||||||
|
" Stop cursor from jumping over wrapped lines
|
||||||
|
nnoremap j gj
|
||||||
|
nnoremap k gk
|
||||||
|
" Make HOME and END behave like shell
|
||||||
|
"inoremap <C-E> <End>
|
||||||
|
"inoremap <C-A> <Home>
|
||||||
|
" }
|
||||||
|
|
||||||
|
" UI Options {
|
||||||
|
" Colorscheme options.
|
||||||
|
set bg=dark
|
||||||
|
colorscheme gruvbox
|
||||||
|
|
||||||
|
" Also highlight all tabs and trailing whitespace characters.
|
||||||
|
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
|
||||||
|
match ExtraWhitespace /\s\+$\|\t/
|
||||||
|
|
||||||
|
" Relative numbering
|
||||||
|
function! NumberToggle()
|
||||||
|
if(&relativenumber == 1)
|
||||||
|
set nornu
|
||||||
|
set number
|
||||||
|
else
|
||||||
|
set rnu
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Toggle between normal and relative numbering.
|
||||||
|
nnoremap <leader>r :call NumberToggle()<cr>
|
||||||
|
|
||||||
|
" Opaque Background (Comment out to use terminal's profile)
|
||||||
|
"set termguicolors
|
||||||
|
|
||||||
|
" Transparent Background (For i3 and compton)
|
||||||
|
"highlight Normal guibg=NONE ctermbg=NONE
|
||||||
|
"highlight LineNr guibg=NONE ctermbg=NONE
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Keybindings {
|
||||||
|
" Save file
|
||||||
|
nnoremap <Leader>w :w<CR>
|
||||||
|
|
||||||
|
" Copy and paste from system clipboard (Might require xsel/xclip install)
|
||||||
|
vmap <Leader>y "+y
|
||||||
|
vmap <Leader>d "+d
|
||||||
|
nmap <Leader>p "+p
|
||||||
|
nmap <Leader>P "+P
|
||||||
|
vmap <Leader>p "+p
|
||||||
|
vmap <Leader>P "+P
|
||||||
|
|
||||||
|
" Move between buffers
|
||||||
|
nmap <Leader>h :bprevious<CR>
|
||||||
|
|
||||||
|
" Switch between Buffers
|
||||||
|
map <C-j> <C-w>j<C-w>_
|
||||||
|
map <C-k> <C-w>k<C-w>_
|
||||||
|
map <C-h> <C-w>h<C-w>_
|
||||||
|
map <C-l> <C-w>l<C-w>_
|
||||||
|
|
||||||
|
" Switch between tabs
|
||||||
|
map <A-h> :tabprevious<CR>
|
||||||
|
map <A-l> :tabnext<CR>
|
||||||
|
|
||||||
|
" Go to tab by number
|
||||||
|
noremap <A-1> 1gt
|
||||||
|
noremap <A-2> 2gt
|
||||||
|
noremap <A-3> 3gt
|
||||||
|
noremap <A-4> 4gt
|
||||||
|
noremap <A-5> 5gt
|
||||||
|
noremap <A-6> 6gt
|
||||||
|
noremap <A-7> 7gt
|
||||||
|
noremap <A-8> 8gt
|
||||||
|
noremap <A-9> 9gt
|
||||||
|
noremap <A-0> :tablast<cr>
|
||||||
|
|
||||||
|
" Open init.vim
|
||||||
|
map <silent> <leader>ee :e $HOME/.config/nvim/init.vim<cr>
|
||||||
|
|
||||||
|
" Open a File in new Tab
|
||||||
|
map <silent> <leader>t :tabnew
|
||||||
|
" }
|
||||||
|
|
||||||
|
|
||||||
|
" Experimental {
|
||||||
|
" Search and Replace
|
||||||
|
nmap <Leader>s :%s//g<Left><Left>
|
||||||
|
" write files as root (if you've forgotten to open it as root
|
||||||
|
" simply do :W instead of :w
|
||||||
|
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Plugin Settings {
|
||||||
|
" Airline {
|
||||||
|
let g:airline#extensions#tabline#enabled = 1
|
||||||
|
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||||
|
let g:airline#extensions#tabline#fnamemod = ':t'
|
||||||
|
let g:airline#extensions#tabline#left_sep = ''
|
||||||
|
let g:airline#extensions#tabline#left_alt_sep = ''
|
||||||
|
let g:airline#extensions#tabline#right_sep = ''
|
||||||
|
let g:airline#extensions#tabline#right_alt_sep = ''
|
||||||
|
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_theme= 'gruvbox'
|
||||||
|
" }
|
||||||
|
" CtrlP {
|
||||||
|
" Open file menu
|
||||||
|
nnoremap <Leader>o :CtrlP<CR>
|
||||||
|
" Open buffer menu
|
||||||
|
nnoremap <Leader>b :CtrlPBuffer<CR>
|
||||||
|
" Open most recently used files
|
||||||
|
nnoremap <Leader>f :CtrlPMRUFiles<CR>
|
||||||
|
" }
|
||||||
|
" neomake {
|
||||||
|
autocmd! BufWritePost * Neomake
|
||||||
|
nnoremap <Leader>l :lopen<CR>
|
||||||
|
" }
|
||||||
|
" netrw {
|
||||||
|
let g:netrw_liststyle=3 " tree (change to 0 for thin)
|
||||||
|
let g:netrw_banner=0 " no banner
|
||||||
|
let g:netrw_altv=1 " open files on right
|
||||||
|
let g:netrw_winsize=25 " only use 20% screen for netrw
|
||||||
|
" FIXME: Preview opens to left and is very narrow
|
||||||
|
let g:netrw_preview=1 " open previews vertically
|
||||||
|
let g:netrw_browse_split =3 " open files in new Tab
|
||||||
|
nmap <Leader>n :Vexplore<CR>
|
||||||
|
" }
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Filetype-Specific Configurations {
|
||||||
|
" HTML, XML, Jinja
|
||||||
|
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
autocmd FileType css setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
autocmd FileType xml setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
autocmd FileType htmldjango setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
autocmd FileType htmldjango inoremap {{ {{ }}<left><left><left>
|
||||||
|
autocmd FileType htmldjango inoremap {% {% %}<left><left><left>
|
||||||
|
autocmd FileType htmldjango inoremap {# {# #}<left><left><left>
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Markdown and Journal {
|
||||||
|
autocmd FileType markdown setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
autocmd FileType journal setlocal shiftwidth=2 tabstop=2 softtabstop=2
|
||||||
|
" }
|
||||||
|
|
||||||
|
" Trim Whitespaces {
|
||||||
|
function! TrimWhitespace()
|
||||||
|
let l:save = winsaveview()
|
||||||
|
%s/\\\@<!\s\+$//e
|
||||||
|
call winrestview(l:save)
|
||||||
|
endfunction
|
||||||
|
" }
|
||||||
|
" vim:set ft=vim sw=4 ts=4:
|
||||||
|
" :set number relativenumber
|
||||||
|
|
||||||
|
:augroup numbertoggle
|
||||||
|
: autocmd!
|
||||||
|
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
|
||||||
|
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
|
||||||
|
:augroup END
|
||||||
|
noremap <F3> :set invnumber invrelativenumber<CR>
|
||||||
|
inoremap <F3> <C-O>:set invnumber invrelativenumber<CR>
|
BIN
.config/nvim/nvimrc
Normal file
BIN
.config/nvim/nvimrc
Normal file
Binary file not shown.
1
.config/nvim/plugged/ctrlp.vim
Submodule
1
.config/nvim/plugged/ctrlp.vim
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 564176f01d7f3f7f8ab452ff4e1f5314de7b0981
|
1
.config/nvim/plugged/deoplete-jedi
Submodule
1
.config/nvim/plugged/deoplete-jedi
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 2d2ff2382fd67574c233d0ce48150b26eb7f6809
|
1
.config/nvim/plugged/gruvbox
Submodule
1
.config/nvim/plugged/gruvbox
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit cb4e7a5643f7d2dd40e694bcbd28c4b89b185e86
|
1
.config/nvim/plugged/neomake
Submodule
1
.config/nvim/plugged/neomake
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit acbbd0e0ce2277c33926c189d0f54825e2ed59d3
|
1
.config/nvim/plugged/vim-airline
Submodule
1
.config/nvim/plugged/vim-airline
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 099dd92eebe09ab27a483e381f2a708945e34330
|
BIN
.config/nvim/spell/en.utf-8.add
Normal file
BIN
.config/nvim/spell/en.utf-8.add
Normal file
Binary file not shown.
BIN
.config/nvim/spell/en.utf-8.add.spl
Normal file
BIN
.config/nvim/spell/en.utf-8.add.spl
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user