mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 16:51:34 +02:00
Minimaze nvim config, update git config, clean configs
This commit is contained in:
parent
9b2871dd65
commit
1f5249ea78
25 changed files with 183 additions and 663 deletions
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
//Snippets
|
||||
"snippets.ultisnips.directories": ["snips"],
|
||||
"snippets.userSnippetsDirectory": "~/.config/nvim/snips",
|
||||
|
||||
//Emmet
|
||||
"emmet.includeLanguages": {
|
||||
"javascript": ["javascript.jsx", "javascriptreact"]
|
||||
},
|
||||
|
||||
// Prettier
|
||||
"prettier.disableSuccessMessage": true,
|
||||
|
||||
// JS/x
|
||||
"tsserver.formatOnType": true,
|
||||
|
||||
// List
|
||||
"list.indicator": ">",
|
||||
"list.selectedSignText": " ",
|
||||
|
||||
// Auto format
|
||||
"coc.preferences.hoverTarget": "float",
|
||||
"coc.preferences.formatOnSaveFiletypes": [
|
||||
"javascript",
|
||||
"javascript.jsx",
|
||||
"javascriptreact",
|
||||
"css",
|
||||
"html",
|
||||
"yaml",
|
||||
"json",
|
||||
"pytnon"
|
||||
]
|
||||
}
|
||||
|
|
@ -1,66 +1,60 @@
|
|||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'Smirnov-O/nten16.vim' " Color scheme
|
||||
Plug 'itchyny/lightline.vim' " Status bar
|
||||
Plug 'maximbaz/lightline-ale' " Linter info in bar
|
||||
Plug 'dense-analysis/ale' " Linter
|
||||
Plug 'airblade/vim-gitgutter' " Git indicator
|
||||
Plug 'ap/vim-css-color' " Preview CSS colors
|
||||
Plug 'jiangmiao/auto-pairs' " Auto close brackets
|
||||
Plug 'editorconfig/editorconfig-vim' " Editor Config support
|
||||
Plug 'christoomey/vim-tmux-navigator' " Jump from vim in tmux
|
||||
Plug 'maxboisvert/vim-simple-complete' " Sublime like completion
|
||||
|
||||
" Language support
|
||||
Plug 'pangloss/vim-javascript', {'for': 'javascript'}
|
||||
Plug 'mxw/vim-jsx', {'for': ['javascript.jsx', 'javascript']}
|
||||
Plug 'plasticboy/vim-markdown', {'for': 'markdown'}
|
||||
Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'}
|
||||
Plug 'cespare/vim-toml', {'for': 'toml'}
|
||||
Plug 'zah/nim.vim', {'for': 'nim'}
|
||||
Plug 'Smirnov-O/nten16.vim'
|
||||
Plug 'itchyny/lightline.vim'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'maxboisvert/vim-simple-complete'
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
Plug 'dense-analysis/ale'
|
||||
"Plug 'editorconfig/editorconfig-vim'
|
||||
call plug#end()
|
||||
syntax on
|
||||
|
||||
" Theme
|
||||
"== General
|
||||
" Appearance
|
||||
set termguicolors
|
||||
colorscheme nten16
|
||||
set t_Co=256
|
||||
|
||||
" number line
|
||||
" Line numbers
|
||||
set nu rnu
|
||||
|
||||
" Line wrap
|
||||
set nowrap nolinebreak
|
||||
|
||||
" Tabs
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set smarttab
|
||||
set expandtab
|
||||
set autoindent
|
||||
|
||||
" Status line
|
||||
"set laststatus=0
|
||||
set noshowmode showcmd
|
||||
set ruler
|
||||
|
||||
" Mouse
|
||||
set mouse=a mousehide
|
||||
set mouse=a
|
||||
set mousehide
|
||||
set cursorline
|
||||
|
||||
" Encoding
|
||||
set encoding=utf-8 fileencodings=utf-8
|
||||
|
||||
" Line wrap
|
||||
set nowrap nolinebreak
|
||||
set encoding=utf-8
|
||||
set fileencodings=utf-8
|
||||
|
||||
" Backup file & history
|
||||
set nobackup noswapfile
|
||||
set history=100
|
||||
|
||||
" Auto reload file
|
||||
set autoread
|
||||
|
||||
" Tabs
|
||||
set ts=4 sts=4
|
||||
set expandtab autoindent
|
||||
set shiftwidth=4
|
||||
|
||||
" Search
|
||||
set incsearch ignorecase smartcase
|
||||
set incsearch
|
||||
set ignorecase
|
||||
set smartcase
|
||||
|
||||
" Buffer(s)
|
||||
set hidden smartindent
|
||||
" Buffer
|
||||
set hidden
|
||||
|
||||
" Spell
|
||||
" Spell checker
|
||||
set spell spelllang=en_us
|
||||
|
||||
" Space/tab indicator
|
||||
|
|
@ -69,58 +63,61 @@ set list listchars=tab:>·,trail:~,extends:>,precedes:<,space:·
|
|||
" Disable sound
|
||||
set visualbell t_vb=
|
||||
|
||||
"== Language configuration
|
||||
let g:jsx_ext_required = 0
|
||||
|
||||
" Markdown
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
let g:markdown_fenced_languages = ['javascript', 'js=javascript', 'jsx=javascript.jsx', 'python', 'bash', 'sh=bash']
|
||||
" == Settings for specific files
|
||||
autocmd BufWritePre *.py normal m`:%s/\s\+$//e ``
|
||||
autocmd FileType python,go setlocal expandtab shiftwidth=4 tabstop=4
|
||||
autocmd FileType html,css,javascript setlocal expandtab shiftwidth=2 tabstop=2
|
||||
|
||||
|
||||
"== Aliases
|
||||
command! W :w
|
||||
command! Q :q
|
||||
command! Wq :wq
|
||||
command! WQ :wq
|
||||
command! Prettier :!prettier %
|
||||
command! ESlint :!eslint %
|
||||
|
||||
|
||||
"== Plug in configuration
|
||||
let g:lightline = {
|
||||
\ 'colorscheme': 'nten16',
|
||||
\ 'active': {
|
||||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'readonly', 'modified' ],
|
||||
\ [ 'linter_errors', 'linter_warnings', 'linter_infos' ] ],
|
||||
\ 'right': [ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'filename', 'filetype' ] ]},
|
||||
\ 'component_expand': {
|
||||
\ 'linter_errors': 'lightline#ale#errors',
|
||||
\ 'linter_infos': 'lightline#ale#infos',
|
||||
\ 'linter_warnings': 'lightline#ale#warnings'
|
||||
\ 'left': [ [ 'mode', 'paste' ],
|
||||
\ [ 'readonly', 'modified' ] ],
|
||||
\ 'right': [ [ 'lineinfo' ],
|
||||
\ [ 'percent' ],
|
||||
\ [ 'filename', 'filetype' ] ]
|
||||
\ }, }
|
||||
|
||||
" Ale
|
||||
let g:ale_disable_lsp = 1
|
||||
let g:ale_sign_error = '> '
|
||||
let g:ale_sign_warning = '- '
|
||||
let g:ale_echo_msg_format = '%severity%: %s'
|
||||
let g:ale_linter = {
|
||||
\ 'javascript': 'eslint',
|
||||
\ 'python': 'flake8'
|
||||
\ }
|
||||
let g:ale_fix_on_save = 1
|
||||
let g:ale_fixers = {
|
||||
\ 'javascript': ['prettier', 'eslint' ],
|
||||
\ 'python': ['flake8', 'pylint8']}
|
||||
\ 'javascript': 'prettier',
|
||||
\ 'python': 'black'
|
||||
\ }
|
||||
|
||||
" == Mapping
|
||||
let mapleader="\\"
|
||||
imap jj <esc>
|
||||
|
||||
" Window(s)
|
||||
nmap <C-h> :wincmd h<CR>
|
||||
nmap <C-j> :wincmd j<CR>
|
||||
nmap <C-k> :wincmd k<CR>
|
||||
nmap <C-l> :wincmd l<CR>
|
||||
nmap <A-z> :wincmd K<CR>
|
||||
nmap <A-x> :wincmd L<CR>
|
||||
nmap <A-c> :wincmd n<CR>
|
||||
"== Mapping
|
||||
let mapleader="'"
|
||||
|
||||
" C-j/k as up/down in menu
|
||||
inoremap <expr> <C-j> ("\<C-n>")
|
||||
inoremap <expr> <C-k> ("\<C-p>")
|
||||
" Window
|
||||
noremap <C-h> :wincmd h<CR>
|
||||
noremap <C-j> :wincmd j<CR>
|
||||
noremap <C-k> :wincmd k<CR>
|
||||
noremap <C-l> :wincmd l<CR>
|
||||
noremap <A-z> :wincmd K<CR>
|
||||
noremap <A-x> :wincmd L<CR>
|
||||
noremap <A-c> :wincmd n<CR>
|
||||
|
||||
" Tab(s)
|
||||
noremap <C-Tab> :tabnext<CR>
|
||||
noremap <C-S-Tab> :tabprev<CR>
|
||||
" Tab
|
||||
noremap <C-t> :tabnew<CR>
|
||||
noremap <C-w> :tabclose<CR>
|
||||
noremap <A-1> :tabn 1<CR>
|
||||
|
|
@ -133,10 +130,10 @@ noremap <A-7> :tabn 7<CR>
|
|||
noremap <A-8> :tabn 8<CR>
|
||||
noremap <A-9> :tabn 9<CR>
|
||||
|
||||
" Buffer(s)
|
||||
noremap <leader>b :bnext<CR>
|
||||
noremap <leader>p :bprev<CR>
|
||||
" Buffer
|
||||
noremap <C-b> :bnext<CR>
|
||||
noremap <C-p> :bprev<CR>
|
||||
|
||||
" Paste & copy from/in system clipboard
|
||||
noremap <leader>c "*yy<CR>
|
||||
" Work with system clipboard
|
||||
noremap <leader>c "*y<CR>
|
||||
noremap <leader>v "+p<CR>
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
snippet pac "Package"
|
||||
package ${1:main}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet import "Import section"
|
||||
import (
|
||||
${1}
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet fn "Function"
|
||||
func ${1:main}(${2:arg} ${3:type}) ${4:type} (
|
||||
${5}
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet for "For loop"
|
||||
for ${1:i\:\=1}; ${2:i\<\=10}; ${3:\i\+\+} {
|
||||
${4}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet var "Variable declaration"
|
||||
var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}}
|
||||
endsnippet
|
||||
|
||||
snippet vars "Variables declaration"
|
||||
var (
|
||||
${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} }
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet : "Variable"
|
||||
${1:v} := ${2:value}
|
||||
endsnippet
|
||||
|
||||
snippet append "Append function"
|
||||
append(${1:slice}, ${0:value})
|
||||
endsnippet
|
||||
|
||||
snippet switch "Switch"
|
||||
switch ${1:var} {
|
||||
case ${2:value}:
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet const "Constant declaration"
|
||||
const ${1:name}${2/(.+)/ /}${2:type} = ${0:value}
|
||||
endsnippet
|
||||
|
||||
snippet consts "Constants declaration"
|
||||
const (
|
||||
${1:constant}${2/(.+)/ /}${2:type} = ${0:value}
|
||||
)
|
||||
endsnippet
|
||||
|
||||
snippet err "Rrror handling"
|
||||
if err != nil {
|
||||
log.${1:Fatal}(err)
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet map "Map type"
|
||||
map[${1:keytype}]${2:valuetupe}
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet ;= ";= to :="
|
||||
:= $0
|
||||
endsnippet
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
priority -50
|
||||
|
||||
snippet `py "Python code block"
|
||||
```python
|
||||
${1}
|
||||
```
|
||||
endsnippet
|
||||
|
||||
snippet `sh "Bash code block"
|
||||
```bash
|
||||
${1}
|
||||
```
|
||||
endsnippet
|
||||
|
||||
snippet `go "GO code block"
|
||||
```go
|
||||
${1}
|
||||
```
|
||||
endsnippet
|
||||
|
||||
snippet // "Comment"
|
||||
<!-- ${1:${VISUAL}} -->
|
||||
endsnippet
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
priority -50
|
||||
|
||||
snippet #! "Shebang"
|
||||
#!/usr/bin/env python
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet ! "Shebang"
|
||||
#!/bin/python
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet ifmain "If __main...."
|
||||
if __name__ == "__main__":
|
||||
${1:code}
|
||||
endsnippet
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
snippet ! "SH Shebang"
|
||||
#!/bin/sh
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet #! "BASH Shebang"
|
||||
#!/bin/bash
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet if "If declaration"
|
||||
if [ ${1} ]; then
|
||||
${2}
|
||||
fi
|
||||
${3}
|
||||
endsnippet
|
||||
|
||||
snippet for "For loop"
|
||||
for (( i=0; i < ${1:10}; i++ )); do
|
||||
${2}
|
||||
done
|
||||
${3}
|
||||
endsnippet
|
||||
|
||||
snippet while "While loop"
|
||||
while ${1:true}; do
|
||||
${2}
|
||||
done
|
||||
${3}
|
||||
endsnippet
|
||||
|
||||
snippet case "Case"
|
||||
case "${1}" in
|
||||
${2}) ${3} ;;
|
||||
esac
|
||||
${4}
|
||||
endsnippet
|
||||
|
||||
snippet fn "Function declaration"
|
||||
function ${1:name}(${2}) {
|
||||
${3}
|
||||
}
|
||||
${4}
|
||||
endsnippet
|
||||
Loading…
Add table
Add a link
Reference in a new issue