config-neovim/init.vim

103 lines
2.8 KiB
VimL
Raw Normal View History

2022-01-06 07:52:01 +00:00
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" my custom settings
2022-01-06 07:52:01 +00:00
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" tabstop: length of an actual \t character:
" shiftwidth: length to use when shifting text (eg. <<, >> and == commands), (0 for tabstop):
" softtabstop: length to use when editing text (eg. TAB and BS keys), (0 for tabstop, -1 for shiftwidth):
" shiftround: round indentation to multiples of 'shiftwidth' when shifting text (so that it behaves like Ctrl-D / Ctrl-T):
set tabstop=4
set shiftwidth=0
set softtabstop=-1
set shiftround
2022-01-06 07:52:01 +00:00
set list
set relativenumber
set number
set expandtab
set autoindent
set smartindent
let mapleader="\<Space>"
let maplocalleader="\<Space>"
" plugin 'toogleterm' need this or it will initialze a new terminal each time foucus on terminal
set hidden
2023-05-19 07:58:36 +00:00
nmap <C-q> <C-w>q
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
lua << EOF
vim.g.markdown_fenced_languages = {
"ts=typescript"
}
EOF
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" config of vim-plug
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let s:plugs = []
2022-11-16 13:12:34 +00:00
function! s:add_plug(name, setup = v:true)
call add(s:plugs, { 'setup': a:setup, 'name': a:name })
endfunction
2022-11-16 13:12:34 +00:00
function! s:plug_name(dict)
return get(a:dict, 'name')
endfunction
2022-11-16 13:12:34 +00:00
function! s:plug_setup(dict)
return get(a:dict, 'setup')
endfunction
2022-11-16 13:12:34 +00:00
" call add_plug('bling/vim-bufferline', v:false)
2022-11-16 13:12:34 +00:00
call s:add_plug('neovim/nvim-lspconfig')
call s:add_plug('kyazdani42/nvim-tree.lua')
2023-05-19 07:58:36 +00:00
call s:add_plug('kyazdani42/nvim-web-devicons', v:false)
2022-11-16 13:12:34 +00:00
call s:add_plug('akinsho/toggleterm.nvim')
call s:add_plug('lukas-reineke/indent-blankline.nvim')
call s:add_plug('jupyter-vim/jupyter-vim')
2023-05-19 07:58:36 +00:00
"call s:add_plug('nvim-lualine/lualine.nvim')
"call s:add_plug('ap/vim-buftabline')
"call s:add_plug('projekt0n/github-nvim-theme')
call s:add_plug('morhetz/gruvbox', v:false)
call s:add_plug('vim-airline/vim-airline', v:false)
call s:add_plug('vim-airline/vim-airline-themes', v:false)
call s:add_plug('bling/vim-bufferline', v:false)
let g:airline_theme='violet'
set background=dark
function! s:setup_file(plug_name)
let l:pos_dot = strridx(a:plug_name, '.')
let l:pos_slash = strridx(a:plug_name, '/')
let l:pos_dot = l:pos_dot > 0 ? l:pos_dot - 1 : -1
let l:pos_slash = l:pos_slash > 0 ? l:pos_slash + 1 : 0
return a:plug_name[l:pos_slash : l:pos_dot] .. '.vim'
endfunction
call plug#begin(has('nvim') ? stdpath('data') .. '/plugged' : '~/.vim/plugged')
for p in s:plugs
2022-11-16 13:12:34 +00:00
Plug get(p, 'name')
endfor
call plug#end()
for p in s:plugs
2022-11-16 13:12:34 +00:00
if s:plug_setup(p)
execute 'source' stdpath('config') .. '/plugins.d/' .. s:setup_file(s:plug_name(p))
endif
endfor