Skip to content

Commit 78ba2e9

Browse files
committed
Migrating to neovim
1 parent 20f656b commit 78ba2e9

5 files changed

Lines changed: 137 additions & 0 deletions

File tree

.config/nvim/aesth

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
"colorscheme
3+
set background=dark
4+
colorscheme solarized8
5+
6+
au ColorScheme * hi Normal ctermbg=None
7+
au ColorScheme * hi NonText ctermbg=None
8+
au ColorScheme * hi LineNr ctermbg=None
9+
au ColorScheme * hi SignColumn ctermbg=None
10+
au ColorScheme * hi VertSplit cterm=None ctermfg=magenta
11+
au ColorScheme * hi EndOfBuffer ctermfg=magenta
12+
au ColorScheme * hi LspDiagnostigsDefaultError ctermfg=red
13+
au ColorScheme * hi LspDiagnostigsDefaultWarning ctermfg=yellow
14+
15+
"startify options
16+
let g:header_ascii = [
17+
\ ' ================= =============== =============== ======== ======== ',
18+
\ ' \\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . // ',
19+
\ ' ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .|| ',
20+
\ ' || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . || ',
21+
\ ' ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .|| ',
22+
\ ' || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . || ',
23+
\ ' ||. . || ||-'' || || `-|| || . .|| ||. . || ||-'' || || `|\_ . .|. .|| ',
24+
\ ' || . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . || ',
25+
\ ' ||_-'' || .|/ || || \|. || `-_|| ||_-'' || .|/ || || | \ / |-_.|| ',
26+
\ ' || ||_-'' || || `-_|| || || ||_-'' || || | \ / | `|| ',
27+
\ ' || `'' || || `'' || || `'' || || | \ / | || ',
28+
\ ' || .==='' `===. .===''.`===. .==='' /==. | \/ | || ',
29+
\ ' || .=='' \_|-_ `===. .==='' _|_ `===. .==='' _-|/ `== \/ | || ',
30+
\ ' || .=='' _-'' `-_ `='' _-'' `-_ `='' _-'' `-_ /| \/ | || ',
31+
\ ' || .=='' _-'' `-__\._-'' `-_./__-'' `'' |. /| | || ',
32+
\ ' ||.=='' _-'' `'' | /==.|| ',
33+
\ ' =='' _-'' \/ `== ',
34+
\ ' \ _-'' `-_ / ',
35+
\ ' `'' ``'' ',
36+
\ ]
37+
38+
let g:startify_custom_header = startify#center(g:header_ascii)
39+
40+
" setup for airline
41+
let g:airline_section_b = '%{strftime("%a %d. %H:%M")}'
42+
"(insertion of j,k,h,l chars)
43+
let g:airline_powerline_fonts = 1
44+
let g:airline_theme = 'minimalist'
45+
46+

.config/nvim/bindings

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
command! Format execute 'lua vim.lsp.buf.formatting()'
2+
3+
"Bindings
4+
map <silent> <F5> : NERDTreeToggle<CR>
5+
nnoremap <S-s> :w! \|:silent !$HOME/scripts/bash/compiler.sh <c-r>%<CR><C-l>
6+
nnoremap <S-m> :w! \|:silent !$HOME/scripts/bash/make.sh <c-r>%<CR><C-l>
7+
nnoremap <silent> <F4> :silent !$HOME/scripts/bash/opout.sh <c-r>%<CR><C-l>
8+
nnoremap <silent> <space> za
9+
nnoremap <silent> <S-c> :call ToggleSyntastic()<CR>
10+
nnoremap <silent> <C-f> :Format<CR>
11+
12+

.config/nvim/init.vim

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"set runtimepath^=~/.vim runtimepath+=~/.vim/after
2+
let &packpath = &runtimepath
3+
source ~/.config/nvim/plugins
4+
source ~/.config/nvim/aesth
5+
source ~/.config/nvim/bindings
6+
7+
" custom setting
8+
syntax on
9+
set mouse=a
10+
set number
11+
set encoding=utf-8
12+
set backspace=indent,eol,start
13+
set cursorline
14+
set nospell
15+
16+
set fillchars+=vert:\▏
17+
" indent for global
18+
set expandtab
19+
set shiftwidth=4
20+
set softtabstop=4
21+
set autoindent
22+
23+
"for markdown suffixes
24+
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md set ft=markdown
25+
au BufNewFile,BufRead *.ino set ft=c
26+
27+
" indent for special file
28+
autocmd FileType c,cpp,html,css,ino setlocal expandtab shiftwidth=2 softtabstop=2 cindent nofoldenable
29+
autocmd FileType python setlocal expandtab shiftwidth=4 softtabstop=4 autoindent
30+
autocmd VimLeave *.tex !bash $HOME/scripts/bash/texclear.sh %
31+
autocmd VimLeave *.md :!pkill grip &
32+
33+
"coding stuff (autocomplete && syntax checking)
34+
let g:diagnostic_virtual_text_prefix = ''
35+
let g:diagnostic_enable_virtual_text = 1
36+
37+
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
38+
let g:completion_enable_snippet = 'Neosnippet'
39+
let g:completion_matching_smart_case = 1
40+
41+
" Use <Tab> and <S-Tab> to navigate through popup menu
42+
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
43+
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
44+
45+
" Set completeopt to have a better completion experience
46+
set completeopt=menuone,noinsert,noselect
47+
48+
" Avoid showing message extra message when using completion
49+
set shortmess+=c
50+
51+
let g:completion_trigger_on_delete = 1
52+
53+
lua require'lspconfig'.clangd.setup{on_attach=require'completion'.on_attach}
54+
lua require'lspconfig'.pyls.setup{on_attach=require'completion'.on_attach}
55+
56+
autocmd BufEnter * lua require'completion'.on_attach()

.config/nvim/plugins

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
call plug#begin(stdpath('data') . '/plugged')
2+
" all plugins
3+
Plug 'scrooloose/nerdtree'
4+
Plug 'vim-airline/vim-airline'
5+
Plug 'lifepillar/vim-solarized8'
6+
Plug 'vim-airline/vim-airline-themes'
7+
Plug 'mhinz/vim-startify'
8+
Plug 'ap/vim-css-color'
9+
Plug 'Yggdroot/indentLine'
10+
Plug 'neovim/nvim-lspconfig'
11+
Plug 'nvim-lua/completion-nvim'
12+
Plug 'Shougo/neosnippet.vim'
13+
Plug 'Shougo/neosnippet-snippets'
14+
Plug 'Raimondi/delimitMate'
15+
" All of your Plugins must be added before the following line
16+
call plug#end()
17+
filetype plugin indent on " required
18+
19+
" setup for indent line
20+
let g:indentLine_char = '│'
21+
set tags=./tags,tags;$HOME
22+

.config/zsh/.zshrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ bindkey -M menuselect 'j' vi-down-line-or-history
4343
bindkey -v '^?' backward-delete-char
4444

4545
#aliases
46+
alias vim='nvim'
4647
alias dgit='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
4748
alias ugit='/usr/bin/git --git-dir=$HOME/Documents/.uni --work-tree=$HOME/Documents'
4849
alias down='systemctl suspend'

0 commit comments

Comments
 (0)