Move all config files to config directory and add corresponding changes to bootstrap script
This commit is contained in:
32
config/nvim/coc-settings.json
Normal file
32
config/nvim/coc-settings.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"coc.preferences.formatOnSaveFiletypes": [
|
||||
"css",
|
||||
"markdown",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"svelte",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"json",
|
||||
"jsonc"
|
||||
],
|
||||
"python.jediEnabled": true,
|
||||
"coc.source.emoji.filetypes": [
|
||||
"markdown",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
"python",
|
||||
"go",
|
||||
"svelte"
|
||||
],
|
||||
"svelte.plugin.svelte.completions.enable": true,
|
||||
"svelte.plugin.css.completions.enable": true,
|
||||
"svelte.plugin.svelte.enable": true,
|
||||
"svelte.plugin.html.enable": true,
|
||||
"svelte.plugin.css.enable": true,
|
||||
"svelte.enable-ts-plugin": true,
|
||||
"svelte.plugin.svelte.format.enable": true,
|
||||
"html.filetypes": ["html", "javascriptreact", "typescriptreact"]
|
||||
}
|
||||
70
config/nvim/coc.vim
Normal file
70
config/nvim/coc.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
" Always show the signcolumn, otherwise it would shift the text each time
|
||||
" diagnostics appear/become resolved.
|
||||
if has("nvim-0.5.0") || has("patch-8.1.1564")
|
||||
" Recently vim can merge signcolumn and number column into one
|
||||
set signcolumn=number
|
||||
else
|
||||
set signcolumn=yes
|
||||
endif
|
||||
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
" GoTo definition
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
|
||||
" Use <C-l> for trigger snippet expand.
|
||||
imap <C-l> <Plug>(coc-snippets-expand)
|
||||
|
||||
" Use F2 to rename a variable, e.g.
|
||||
nmap <F2> <Plug>(coc-rename)
|
||||
|
||||
let g:coc_global_extensions = [
|
||||
\ 'coc-tsserver',
|
||||
\ 'coc-css',
|
||||
\ 'coc-go',
|
||||
\ 'coc-html',
|
||||
\ 'coc-prettier',
|
||||
\ 'coc-sh',
|
||||
\ 'coc-svelte',
|
||||
\ 'coc-pairs',
|
||||
\ 'coc-json',
|
||||
\ 'coc-snippets',
|
||||
\ 'coc-emmet',
|
||||
\ 'coc-highlight',
|
||||
\ 'coc-python',
|
||||
\ 'coc-emoji'
|
||||
\ ]
|
||||
|
||||
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
|
||||
" Coc only does snippet and additional edit on confirm.
|
||||
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
|
||||
command! -nargs=0 Prettier :CocCommand prettier.formatFile
|
||||
|
||||
" Use K to show documentation in preview window
|
||||
nnoremap <silent> K :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
else
|
||||
call CocAction('doHover')
|
||||
endif
|
||||
endfunction
|
||||
20
config/nvim/file-tree.vim
Normal file
20
config/nvim/file-tree.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
lua << EOF
|
||||
require("nvim-tree").setup {}
|
||||
EOF
|
||||
|
||||
let g:nvim_tree_width = 20
|
||||
let g:nvim_tree_ignore = [ '.git' ]
|
||||
let g:nvim_tree_add_trailing = 1
|
||||
let g:nvim_tree_quit_on_open = 1
|
||||
let g:nvim_tree_indent_markers = 1
|
||||
let g:nvim_tree_refresh_wait = 500
|
||||
let g:nvim_tree_show_icons = {
|
||||
\ 'git': 0,
|
||||
\ 'folders': 0,
|
||||
\ 'files': 0,
|
||||
\ 'folder_arrows': 0,
|
||||
\ }
|
||||
|
||||
" Remaps
|
||||
nnoremap <C-b> :NvimTreeToggle<CR>
|
||||
nnoremap <leader>r :NvimTreeRefresh<CR>
|
||||
27
config/nvim/general.vim
Normal file
27
config/nvim/general.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
syntax on
|
||||
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
set autoindent
|
||||
|
||||
set number
|
||||
set relativenumber
|
||||
set wrap
|
||||
set noswapfile
|
||||
set encoding=utf-8
|
||||
set hidden
|
||||
set nowritebackup
|
||||
set cmdheight=2
|
||||
set updatetime=300
|
||||
set shortmess+=c
|
||||
set mouse=a " nv for normal and visual only
|
||||
set cursorline
|
||||
set clipboard+=unnamedplus
|
||||
set splitright
|
||||
set splitbelow
|
||||
|
||||
set termguicolors
|
||||
|
||||
" MY LEADER KEY IS GONNA BE A SPACE
|
||||
let mapleader = " "
|
||||
41
config/nvim/init.vim
Normal file
41
config/nvim/init.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
source $HOME/.config/nvim/plugins.vim
|
||||
source $HOME/.config/nvim/general.vim
|
||||
source $HOME/.config/nvim/remaps.vim
|
||||
source $HOME/.config/nvim/theme.vim
|
||||
source $HOME/.config/nvim/terminal.vim
|
||||
source $HOME/.config/nvim/file-tree.vim
|
||||
source $HOME/.config/nvim/coc.vim
|
||||
source $HOME/.config/nvim/tabs.vim
|
||||
|
||||
" Filetypes for markdown extension
|
||||
let g:mkdp_filetypes = ['md', 'mdx', 'markdown']
|
||||
|
||||
let g:svelte_preprocessors = ['typescript', 'scss']
|
||||
|
||||
let g:closetag_filenames = '*.html,*.svelte,*.jsx,*.tsx'
|
||||
let g:closetag_regions = {
|
||||
\ 'typescript.tsx': 'jsxRegion,tsxRegion',
|
||||
\ 'javascript.jsx': 'jsxRegion',
|
||||
\ 'typescriptreact': 'jsxRegion,tsxRegion',
|
||||
\ 'javascriptreact': 'jsxRegion',
|
||||
\ }
|
||||
|
||||
" Ignore files inside .git directory by CtrlP
|
||||
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
||||
|
||||
lua << EOF
|
||||
require("gitsigns").setup {
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 500,
|
||||
},
|
||||
signcolumn = false,
|
||||
linehl = false,
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false
|
||||
}
|
||||
}
|
||||
require("gitabra").setup {}
|
||||
EOF
|
||||
1
config/nvim/nvim
Symbolic link
1
config/nvim/nvim
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/daniil/dotfiles/config/nvim
|
||||
27
config/nvim/plugins.vim
Normal file
27
config/nvim/plugins.vim
Normal file
@@ -0,0 +1,27 @@
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
|
||||
Plug 'ayu-theme/ayu-vim'
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
Plug 'kyazdani42/nvim-tree.lua'
|
||||
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
|
||||
Plug 'akinsho/bufferline.nvim'
|
||||
Plug 'alvan/vim-closetag'
|
||||
Plug 'kyazdani42/nvim-web-devicons'
|
||||
Plug 'kevinoid/vim-jsonc'
|
||||
Plug 'fatih/vim-go'
|
||||
Plug 'ctrlpvim/ctrlp.vim'
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'evanleck/vim-svelte'
|
||||
Plug 'HerringtonDarkholme/yats.vim'
|
||||
Plug 'yuezk/vim-js'
|
||||
Plug 'lukas-reineke/indent-blankline.nvim'
|
||||
Plug 'lewis6991/gitsigns.nvim'
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'Odie/gitabra'
|
||||
|
||||
call plug#end()
|
||||
52
config/nvim/remaps.vim
Normal file
52
config/nvim/remaps.vim
Normal file
@@ -0,0 +1,52 @@
|
||||
" These allow me to quickly save and quit vim
|
||||
nnoremap <leader>w :w<CR>
|
||||
nnoremap <leader>q :q<CR>
|
||||
|
||||
" Remaps to move line under the cursor up and down
|
||||
nnoremap <C-k> :m .-2<CR>==
|
||||
nnoremap <C-j> :m .+1<CR>==
|
||||
vnoremap K :m '<-2<CR>gv=gv
|
||||
vnoremap J :m '>+1<CR>gv=gv
|
||||
|
||||
" Move split panes to left/bottom/top/right
|
||||
nnoremap <A-h> <C-W>H
|
||||
nnoremap <A-j> <C-W>J
|
||||
nnoremap <A-k> <C-W>K
|
||||
nnoremap <A-l> <C-W>L
|
||||
|
||||
" move between panes to left/bottom/top/right
|
||||
nnoremap <nowait><leader>h <C-w>h
|
||||
nnoremap <leader>j <C-w>j
|
||||
nnoremap <leader>k <C-w>k
|
||||
nnoremap <leader>l <C-w>l
|
||||
tnoremap <A-h> <C-\><C-n><C-w>h
|
||||
tnoremap <A-j> <C-\><C-n><C-w>j
|
||||
tnoremap <A-k> <C-\><C-n><C-w>k
|
||||
tnoremap <A-l> <C-\><C-n><C-w>l
|
||||
|
||||
" Remove search highlighting
|
||||
noremap <leader>nh :nohl<CR>
|
||||
|
||||
" Use Ctrl+A to select the whole file
|
||||
nnoremap <C-a> ggVG
|
||||
|
||||
function! OpenTerminal()
|
||||
split term://bash
|
||||
resize 10
|
||||
endfunction
|
||||
" Open terminal
|
||||
nnoremap <leader>t :call OpenTerminal()<CR>
|
||||
|
||||
" Open Gitabra
|
||||
nnoremap <leader>g :Gitabra<CR>
|
||||
|
||||
" Open splits
|
||||
nnoremap <leader>v :vs<CR>
|
||||
nnoremap <leader>vv :sp<CR>
|
||||
|
||||
" Use Ctrl+Shift+jk to resize panes
|
||||
nnoremap <C-j> :resize -2<CR>
|
||||
nnoremap <C-k> :resize +2<CR>
|
||||
|
||||
" Remap to toggle gitsigns as linehl
|
||||
nnoremap <leader>sg :Gitsigns toggle_linehl<CR>
|
||||
19
config/nvim/tabs.vim
Normal file
19
config/nvim/tabs.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
lua << EOF
|
||||
require("bufferline").setup{}
|
||||
EOF
|
||||
|
||||
nnoremap <silent><C-[> :BufferLineCyclePrev<CR>
|
||||
nnoremap <silent><C-]> :BufferLineCycleNext<CR>
|
||||
|
||||
nnoremap <silent><leader>1 <Cmd>BufferLineGoToBuffer 1<CR>
|
||||
nnoremap <silent><leader>2 <Cmd>BufferLineGoToBuffer 2<CR>
|
||||
nnoremap <silent><leader>3 <Cmd>BufferLineGoToBuffer 3<CR>
|
||||
nnoremap <silent><leader>4 <Cmd>BufferLineGoToBuffer 4<CR>
|
||||
nnoremap <silent><leader>5 <Cmd>BufferLineGoToBuffer 5<CR>
|
||||
nnoremap <silent><leader>6 <Cmd>BufferLineGoToBuffer 6<CR>
|
||||
nnoremap <silent><leader>7 <Cmd>BufferLineGoToBuffer 7<CR>
|
||||
nnoremap <silent><leader>8 <Cmd>BufferLineGoToBuffer 8<CR>
|
||||
nnoremap <silent><leader>9 <Cmd>BufferLineGoToBuffer 9<CR>
|
||||
|
||||
" Close tab
|
||||
nnoremap <leader>e :bd<CR>
|
||||
2
config/nvim/terminal.vim
Normal file
2
config/nvim/terminal.vim
Normal file
@@ -0,0 +1,2 @@
|
||||
" Use Escape to go to normal mode
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
7
config/nvim/theme.vim
Normal file
7
config/nvim/theme.vim
Normal file
@@ -0,0 +1,7 @@
|
||||
" Colorscheme
|
||||
let ayucolor = 'mirage'
|
||||
colorscheme ayu
|
||||
|
||||
" Airline
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline_theme = 'ayu_mirage'
|
||||
Reference in New Issue
Block a user