2022-07-26 11:57:25 +01:00
|
|
|
" set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
|
|
|
" let &packpath = &runtimepath
|
|
|
|
" source ~/.vimrc
|
|
|
|
|
|
|
|
call plug#begin()
|
|
|
|
" The default plugin directory will be as follows:
|
|
|
|
" - Vim (Linux/macOS): '~/.vim/plugged'
|
|
|
|
" - Vim (Windows): '~/vimfiles/plugged'
|
|
|
|
" - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
|
|
|
|
" You can specify a custom plugin directory by passing it as the argument
|
|
|
|
" - e.g. `call plug#begin('~/.vim/plugged')`
|
|
|
|
" - Avoid using standard Vim directory names like 'plugin'
|
|
|
|
|
|
|
|
" Make sure you use single quotes
|
|
|
|
|
|
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
2022-07-27 08:40:33 +01:00
|
|
|
Plug 'sonph/onehalf', {'rtp': 'vim/'}
|
2022-07-26 11:57:25 +01:00
|
|
|
Plug 'joshdick/onedark.vim'
|
|
|
|
Plug 'mileszs/ack.vim'
|
|
|
|
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
|
|
Plug 'junegunn/fzf.vim'
|
2022-07-26 16:36:14 +01:00
|
|
|
Plug 'liuchengxu/vista.vim'
|
2022-07-26 11:57:25 +01:00
|
|
|
Plug 'tpope/vim-unimpaired'
|
|
|
|
Plug 'tpope/vim-fugitive'
|
2022-07-26 16:36:14 +01:00
|
|
|
Plug 'tpope/vim-commentary'
|
2022-07-26 11:57:25 +01:00
|
|
|
Plug 'airblade/vim-gitgutter'
|
|
|
|
Plug 'vim-airline/vim-airline'
|
|
|
|
Plug 'vim-airline/vim-airline-themes'
|
2022-07-26 16:36:14 +01:00
|
|
|
" Plug 'itchyny/lightline.vim'
|
2022-07-26 11:57:25 +01:00
|
|
|
Plug 'christoomey/vim-tmux-navigator'
|
|
|
|
|
|
|
|
" Initialize plugin system
|
|
|
|
call plug#end()
|
|
|
|
|
2022-07-27 08:40:33 +01:00
|
|
|
set mouse=nv
|
2022-08-04 14:53:09 +01:00
|
|
|
let g:python3_host_prog = '~/.pyenv/versions/neovim3/bin/python'
|
2022-07-26 11:57:25 +01:00
|
|
|
|
2022-08-04 15:16:20 +01:00
|
|
|
luafile ~/.vim/lsp_config.lua
|
2022-07-26 11:57:25 +01:00
|
|
|
|
|
|
|
map ; :Files<CR>
|
|
|
|
if executable('ag')
|
|
|
|
let g:ackprg = 'ag --vimgrep'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolor")
|
|
|
|
set termguicolors
|
|
|
|
endif
|
2022-07-27 08:40:33 +01:00
|
|
|
colorscheme onehalfdark
|
|
|
|
let g:airline_theme='onehalfdark'
|
2022-07-26 11:57:25 +01:00
|
|
|
|
|
|
|
set cursorline
|
|
|
|
let mapleader=","
|
|
|
|
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
set listchars=trail:.,tab:>_
|
|
|
|
set list
|
|
|
|
set wrap
|
|
|
|
set linebreak
|
|
|
|
set autoread
|
|
|
|
|
|
|
|
au BufRead,BufNewFile *.ipynb setlocal filetype=json
|
|
|
|
au BufRead,BufNewFile *.md setlocal spell
|
|
|
|
au BufRead,BufNewFile *.code-workspace setlocal filetype=json
|
|
|
|
au BufRead,BufNewFile *.csv setlocal nowrap
|
|
|
|
au BufRead,BufNewFile *.service[a-zA-Z0-9]* setlocal filetype=systemd
|
|
|
|
au TermOpen * setlocal nonumber norelativenumber
|
|
|
|
syntax on
|
|
|
|
|
|
|
|
if &diff
|
|
|
|
highlight! link DiffText MatchParen
|
|
|
|
endif
|
|
|
|
au OptionSet diff highlight! link DiffText MatchParen
|
|
|
|
|
|
|
|
set expandtab
|
|
|
|
set autoindent
|
|
|
|
set smartindent
|
|
|
|
filetype plugin indent on
|
|
|
|
|
2022-07-26 16:36:14 +01:00
|
|
|
let g:vista_default_executive = 'nvim_lsp'
|
2022-08-08 17:31:37 +01:00
|
|
|
let g:vista_fzf_preview = ['right:50%']
|
2022-07-26 16:36:14 +01:00
|
|
|
|
2022-07-26 11:57:25 +01:00
|
|
|
imap jk <Esc>
|
|
|
|
command Bd b# | bd #
|
|
|
|
command! BufOnly silent! execute "%bd|e#|bd#"
|
|
|
|
nnoremap <Leader>b :buffers<CR>:buffer<Space>
|
|
|
|
nnoremap <leader>n :NERDTreeFocus<CR>
|
2022-08-08 17:31:37 +01:00
|
|
|
nnoremap <leader>k :Vista<CR>
|
2022-07-26 16:36:14 +01:00
|
|
|
nnoremap <leader>; :Vista finder<CR>
|
2022-07-26 11:57:25 +01:00
|
|
|
nnoremap <C-n> :NERDTree<CR>
|
|
|
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
|
|
|
nnoremap <C-f> :NERDTreeFind<CR>
|
|
|
|
nnoremap <Leader>a :Ack!<Space>
|
|
|
|
|
|
|
|
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
|
|
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
|
|
|
|
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
|
|
|
|
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
|
|
|
|
|
2022-08-04 15:16:20 +01:00
|
|
|
" function! GitStatus()
|
|
|
|
" let [a,m,r] = GitGutterGetHunkSummary()
|
|
|
|
" return printf('%s +%d ~%d -%d', FugitiveHead(), a, m, r)
|
|
|
|
" endfunction
|
|
|
|
"
|
2022-07-26 11:57:25 +01:00
|
|
|
" let g:slime_target = "tmux"
|
|
|
|
" let g:slime_default_config = {"socket_name": get(split($TMUX, ","), 0), "target_pane": "{last}"}
|
2022-08-04 15:16:20 +01:00
|
|
|
"
|
2022-07-26 11:57:25 +01:00
|
|
|
" let g:lightline = { 'colorscheme': 'onehalfdark' }
|
|
|
|
" let g:lightline.component_expand = {
|
|
|
|
" \ 'linter_checking': 'lightline#ale#checking',
|
|
|
|
" \ 'linter_infos': 'lightline#ale#infos',
|
|
|
|
" \ 'linter_warnings': 'lightline#ale#warnings',
|
|
|
|
" \ 'linter_errors': 'lightline#ale#errors',
|
|
|
|
" \ 'linter_ok': 'lightline#ale#ok',
|
|
|
|
" \ }
|
|
|
|
" let g:lightline.component_type = {
|
|
|
|
" \ 'linter_checking': 'right',
|
|
|
|
" \ 'linter_infos': 'right',
|
|
|
|
" \ 'linter_warnings': 'warning',
|
|
|
|
" \ 'linter_errors': 'error',
|
|
|
|
" \ 'linter_ok': 'right',
|
|
|
|
" \ }
|
|
|
|
" let g:lightline.component_function = {
|
|
|
|
" \ 'gitstatus': 'GitStatus'
|
|
|
|
" \ }
|
|
|
|
" let g:lightline.active = {
|
|
|
|
" \ 'left': [ [ 'mode', 'paste' ],
|
|
|
|
" \ [ 'gitstatus', 'readonly', 'filename', 'modified' ] ],
|
|
|
|
" \ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ],
|
|
|
|
" \ [ 'percent' ],
|
|
|
|
" \ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
|
|
|
" \ }
|
|
|
|
" set laststatus=0
|
|
|
|
" set noshowmode
|