mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 16:51:34 +02:00
Addd snippets for vim, update i3 hotkeys
This commit is contained in:
parent
f7c0cef79f
commit
25b4e80c8d
10 changed files with 195 additions and 47 deletions
45
config/nvim/UltiSnips/go.snippets
Normal file
45
config/nvim/UltiSnips/go.snippets
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
snippet pkg "Package"
|
||||
package ${1:main}
|
||||
endsnippet
|
||||
|
||||
snippet import "Import section"
|
||||
import (
|
||||
${1}
|
||||
)
|
||||
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 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 ;= ";= to :="
|
||||
:= $1
|
||||
endsnippet
|
||||
23
config/nvim/UltiSnips/markdown.snippets
Normal file
23
config/nvim/UltiSnips/markdown.snippets
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
10
config/nvim/UltiSnips/python.snippets
Normal file
10
config/nvim/UltiSnips/python.snippets
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
priority -50
|
||||
|
||||
snippet #! "Shebang"
|
||||
#!/usr/bin/env python
|
||||
endsnippet
|
||||
|
||||
snippet ifmain "If __main...."
|
||||
if __name__ == "__main__":
|
||||
${1:code}
|
||||
endsnippet
|
||||
39
config/nvim/UltiSnips/sh.snippets
Normal file
39
config/nvim/UltiSnips/sh.snippets
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
snippet !sh "SH Shebang"
|
||||
#!/bin/sh
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet !bash "BASH Shebang"
|
||||
#!/bin/bash
|
||||
${1}
|
||||
endsnippet
|
||||
|
||||
snippet if "If declaration"
|
||||
if [ ${1} ]; then
|
||||
${2}
|
||||
fi
|
||||
endsnippet
|
||||
|
||||
snippet for "For loop"
|
||||
for (( i=0; i < ${1:10}; i++ )); do
|
||||
${2}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet while "While loop"
|
||||
while ${1:true}; do
|
||||
${2}
|
||||
done
|
||||
endsnippet
|
||||
|
||||
snippet case "Case"
|
||||
case "${1:$variable}" in
|
||||
"${2}") ${3} ;;
|
||||
esac
|
||||
endsnippet
|
||||
|
||||
snippet fn "Function declaration"
|
||||
function ${1:name}(${2}) {
|
||||
${3}
|
||||
}
|
||||
endsnippet
|
||||
|
|
@ -7,6 +7,8 @@ call plug#begin('~/.vim/plugged')
|
|||
Plug 'ap/vim-css-color' " CSS color preview
|
||||
Plug 'airblade/vim-gitgutter' " Git indicator
|
||||
Plug 'preservim/nerdcommenter' " Code commenter
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'voldikss/vim-floaterm' " Terminal
|
||||
|
||||
" Project/file navigation
|
||||
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
|
||||
|
|
@ -25,7 +27,7 @@ call plug#begin('~/.vim/plugged')
|
|||
Plug 'vim-python/python-syntax', {'for': 'python'}
|
||||
Plug 'alaviss/nim.nvim', {'for': 'nim'}
|
||||
Plug 'fatih/vim-go', {'for': 'go'}
|
||||
"Plug 'nsf/gocode', {'for': 'go'}
|
||||
Plug 'nsf/gocode', {'for': 'go'}
|
||||
Plug 'PotatoesMaster/i3-vim-syntax', {'for': 'i3'}
|
||||
Plug 'kovetskiy/sxhkd-vim', {'for': 'sxhkd'}
|
||||
call plug#end()
|
||||
|
|
@ -101,6 +103,7 @@ let g:lightline = {
|
|||
|
||||
" Markdown
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
let g:vim_markdown_frontmatter=1
|
||||
let g:markdown_fenced_languages = ['go', 'python', 'bash', 'sh=bash']
|
||||
let g:ficus_dir = "~/Documents/Notes"
|
||||
|
||||
|
|
@ -110,15 +113,22 @@ let g:rainbow_active = 1
|
|||
" Python
|
||||
let g:python_higlight_all = 1
|
||||
|
||||
" YouCompleteMe
|
||||
let g:ycm_key_list_previous_completion=['<Up>']
|
||||
" Floaterm
|
||||
let g:floaterm_title = ""
|
||||
let g:floaterm_wintype = "floating"
|
||||
let g:floaterm_position = "bottomright"
|
||||
let g:floaterm_borderchars = ""
|
||||
let g:floaterm_height = 0.4
|
||||
let g:floaterm_width = 0.5
|
||||
let g:floaterm_autoclose = 2
|
||||
nmap <A-t> :FloatermNew<CR>
|
||||
|
||||
|
||||
" UltiSnipts
|
||||
let g:UltiSnipsExpandTrigger="<c-tab>"
|
||||
let g:UltiSnipsListSnippets="<c-s-tab>"
|
||||
"let g:UltiSnipsJumpForwardTrigger="<c-j>"
|
||||
"let g:UltiSnipsJumpBackwardTrigger="<c-k>"
|
||||
|
||||
let g:UltiSnipsExpandTrigger="<C-a>"
|
||||
let g:UltiSnipsEditSplit="vertical"
|
||||
let g:UltiSnipsJumpForwardTrigger="<C-a>"
|
||||
let g:UltiSnipsJumpBackwardTrigger="<C-s>"
|
||||
|
||||
" Go
|
||||
let g:go_template_autocreate = 0
|
||||
|
|
@ -187,5 +197,6 @@ noremap <leader>p :bnext<CR>
|
|||
noremap <leader>o :bprev<CR>
|
||||
|
||||
" Plugins
|
||||
map <leader>gg :Goyo 80%x95% <CR>
|
||||
map <F9> :TagbarToggle<CR>
|
||||
map <C-b> :NERDTreeToggle<CR>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue