Baltazár Radics 2 years ago
parent
commit
482409c0df
Signed by: baltazar GPG Key ID: 9440F591E4397C3E
  1. 9
      .config/coc/extensions/package.json
  2. 127
      .config/nvim/clang-format
  3. 166
      .config/nvim/init.vim
  4. 6
      .config/redshift/hooks/notify.sh
  5. 7
      .config/zsh/.zshrc
  6. 0
      .config/zsh/plugins.txt
  7. 1
      .config/zsh/zshrc
  8. 21
      .gitignore
  9. 11
      .local/bin/screenshot
  10. 15
      .local/bin/ss
  11. 37
      .ssh/config
  12. 2
      .vim/coc-settings.json
  13. 201
      .vim/vimrc

9
.config/coc/extensions/package.json

@ -1,9 +0,0 @@
{
"dependencies": {
"coc-highlight": ">=1.2.5",
"coc-json": ">=1.2.5",
"coc-python": ">=1.2.9",
"coc-snippets": ">=2.1.21",
"coc-vimlsp": ">=0.4.5"
}
}

127
.config/nvim/clang-format

@ -1,127 +0,0 @@
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: All
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
...

166
.config/nvim/init.vim

@ -1,166 +0,0 @@
set autowrite
set clipboard+=unnamed
set shiftwidth=2 tabstop=2
set foldmethod=syntax foldlevelstart=99
set ignorecase smartcase
set linebreak
set makeprg=make\ -s\ -j$(nproc)
set modeline
set mouse=a
set path+=**
set scrolloff=3
set showmatch
set title
set undofile
set updatetime=300
set keymap=magyar iminsert=0
set diffopt+=iwhite
set list listchars=tab:\ \
command! DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
"Enable fancy colors
if $TERM isnot# 'linux'
set termguicolors
endif
let g:man_hardwrap = 1
let g:netrw_banner = 0
let g:python_recommended_style = 0
let g:tex_comment_nospell = 1
let g:tex_fold_enabled = 1
autocmd FileType tex setlocal spell
autocmd FileType python setlocal foldmethod=indent
autocmd BufWritePre /tmp/* setlocal noundofile
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line('$') && &ft !~# 'commit'
\| exe 'normal! g`"'
\|endif
nmap <Leader>/ :noh<CR>
nmap Y y$
tnoremap <Esc> <C-\><C-n>
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
inoremap <A-h> <C-\><C-N><C-w>h
inoremap <A-j> <C-\><C-N><C-w>j
inoremap <A-k> <C-\><C-N><C-w>k
inoremap <A-l> <C-\><C-N><C-w>l
nnoremap <A-h> <C-w>h
nnoremap <A-j> <C-w>j
nnoremap <A-k> <C-w>k
nnoremap <A-l> <C-w>l
highlight Error guibg=DarkRed ctermbg=1
highlight ErrorMsg guibg=DarkRed ctermbg=1
highlight ErrorText guisp=Red gui=undercurl
highlight Folded NONE guifg=Cyan ctermfg=14
highlight Info guifg=Cyan ctermfg=12
highlight Pmenu guibg=DarkMagenta ctermbg=6
highlight PmenuSel guifg=Blue guibg=Magenta ctermfg=0 ctermbg=13
highlight SpellBad guisp=Red gui=undercurl
highlight SpellCap guisp=Magenta gui=undercurl
highlight SpellRare guisp=Yellow gui=undercurl
highlight Visual guibg=#403d3d
highlight Warning guifg=Blue guibg=Yellow ctermfg=0 ctermbg=11
highlight WarningText guisp=Yellow gui=undercurl
highlight manUnderline guifg=Green ctermfg=2
highlight link Whitespace NONE
let g:haveNode = executable('npm') || executable('yarn')
let g:haveLatex = executable('latexmk')
let g:haveGdb = executable('gdb')
let g:haveCtags = executable('ctags')
function! s:MyPlugins()
call plug#begin(stdpath('data').'/plugged')
if g:haveNode
Plug 'neoclide/coc.nvim', {'branch': 'release'}
endif
if g:haveLatex
Plug 'lervag/vimtex'
endif
if g:haveCtags
Plug 'majutsushi/tagbar', { 'on_cmd' : 'TagbarToggle' }
endif
Plug 'junegunn/vim-easy-align'
call plug#end()
if g:haveGdb
packadd termdebug
endif
endfunction
function s:MyPluginSettings()
if g:haveNode
" coc:
nmap <silent> gd <Plug>(coc-definition)
"nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" coc-snippets:
let g:coc_snippet_next = '<c-j>'
let g:coc_snippet_prev = '<c-k>'
endif
if g:haveLatex
" vimtex:
let g:vimtex_compiler_latexmk = {'build_dir': 'build'}
let g:vimtex_compiler_latexmk_engines = {'_': '-lualatex'}
if executable('llpp.inotify')
let g:vimtex_view_general_viewer = 'llpp.inotify'
endif
autocmd FileType tex inoremap <expr> <buffer> `` vimtex#imaps#wrap_math("``", '`')
endif
" EasyAlign:
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
let g:easy_align_delimiters = {
\ '/': {
\ 'pattern': '//\+\|/\*\|\ \*',
\ 'delimiter_align': 'l',
\ 'ignore_groups': ['!Comment'],
\ },
\ '\': {
\ 'pattern': '\\',
\ 'indentation': 'keep',
\ 'left_margin': 1,
\ 'delimiter_align': 'center',
\ 'ignore_groups': ['String', 'Comment'],
\ },
\ }
autocmd FileType markdown imap <buffer> <Bar> <Bar><Esc>m`gaip*<Bar>``A
endfunction
"Install Plug if not found
if empty(glob(stdpath('data').'/site/autoload/plug.vim'))
function! s:PlugInit(jobId, exitCode, eventType)
if a:exitCode != 0
echoerr 'Failed to download vim-plug.'
else
call <SID>MyPlugins()
PlugInstall --sync
call <SID>MyPluginSettings()
endif
endfunction
function! s:PlugInstall()
let jobid = jobstart(['/usr/bin/curl', '--create-dirs',
\ '-fLo', stdpath('data').'/site/autoload/plug.vim',
\ 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
\ ], {
\ 'on_exit': function('<SID>PlugInit'),
\ })
if jobid > 0
echomsg 'Downloading vim-plug...'
else
echoerr 'Curl not found.'
endif
endfunction
command! Plugins call <SID>PlugInstall()
else
call <SID>MyPlugins()
call <SID>MyPluginSettings()
endif

6
.config/redshift/hooks/notify.sh

@ -1,6 +0,0 @@
#! /bin/sh
case $1 in
period-changed)
#exec notify-send -a "Redshift" "Period changed to $3"
esac

7
.config/zsh/.zshrc

@ -5,7 +5,8 @@ export CXX='/usr/bin/clang++'
export EDITOR='/usr/bin/nvim'
export LESS='-R '
export LESSOPEN='| /usr/bin/src-hilite-lesspipe.sh %s'
export MANPAGER='/usr/bin/nvim +Man!'
#export MANPAGER='/usr/bin/nvim +Man!'
export MANPAGER='/usr/bin/vim --not-a-term -c MANPAGER -'
export PAGER='/usr/bin/less'
export PASSWORD_STORE_DIR="$HOME/.local/share/pass"
export PDFVIEWER='/usr/bin/okular'
@ -145,9 +146,9 @@ else
echo 'Installing antibody...'
getantibody || break
fi
if [[ ! "$ZDOTDIR/.plugins.zsh" -nt "$ZDOTDIR/.plugins.txt" ]]; then
if [[ ! "$ZDOTDIR/.plugins.zsh" -nt "$ZDOTDIR/plugins.txt" ]]; then
echo 'Updating plugins...'
antibody bundle <"$ZDOTDIR/.plugins.txt" >"$ZDOTDIR/.plugins.zsh" || break
antibody bundle <"$ZDOTDIR/.pluginstxt" >"$ZDOTDIR/.plugins.zsh" || break
zcompile "$ZDOTDIR/.plugins.zsh"
fi
plugins

0
.config/zsh/.plugins.txt → .config/zsh/plugins.txt

1
.config/zsh/zshrc

@ -0,0 +1 @@
.zshrc

21
.gitignore

@ -3,34 +3,25 @@
!.config/cmus/
!.config/cmus/rc
!.config/cmus/tmux.conf
!.config/coc/
!.config/coc/extensions/
!.config/coc/extensions/package.json
!.config/git/
!.config/git/config
!.config/git/ignore
!.config/nvim/
!.config/nvim/clang-format
!.config/nvim/coc-settings.json
!.config/nvim/init.vim
!.config/redshift.conf
!.config/redshift/
!.config/redshift/hooks/
!.config/redshift/hooks/notify.sh
!.config/termite/
!.config/termite/config
!.config/yay/
!.config/yay/config.json
!.config/zsh/
!.config/zsh/.plugins.txt
!.config/zsh/.zshrc
!.config/zsh/plugins.txt
!.config/zsh/zshrc
!.gitignore
!.local/
!.local/bin
!.local/bin/ss
!.local/bin/screenshot
!.scrc
!.ssh/
!.ssh/config
!.tmux.conf
!.toprc
!.vim/
!.vim/coc-settings.json
!.vim/vimrc
!.zprofile

11
.local/bin/screenshot

@ -0,0 +1,11 @@
#!/bin/sh
file='/tmp/screenshot.png'
if [ "$1" = 'r' ]; then
import -window root "$file"
else
import "$file"
fi
xclip -sel clip -t 'image/png' -i "$file"
# vim: ts=2 sw=0 noet

15
.local/bin/ss

@ -1,15 +0,0 @@
#! /bin/sh
file="/tmp/screenshot.png"
case "$1" in
"r") # whole screen
import -window root $file
;;
"w") # selected window
import -window $(xwininfo | grep -o "0x\w*" | head -1) $file
;;
*) # rectangular region
import $file
;;
esac
xclip -sel clip -t image/png -i /tmp/screenshot.png

37
.ssh/config

@ -1,37 +0,0 @@
Host minervaFromOutside
HostName deneb.strangled.net
Port 8443
Host denebFromOutside
HostName deneb
ProxyJump minervaFromOutside
Host pongFromOutside
HostName pong
ProxyJump minervaFromOutside
Host kfgShares
HostName shares.karinthy.hu
User baltitenger
Host gaborVPS
HostName 37.221.213.41
Host gaborStudio
HostName 37.221.213.41
User studio
port 44422
Host gaborPorta
HostName 37.221.213.41
port 44423
Host sv-linux
HostName baluson.asuscomm.com
port 8443
Host *
ForwardAgent yes
User baltazar
ControlPath /run/user/%i/ssh-%r@%h:%p.sock
ControlPersist 6h

2
.config/nvim/coc-settings.json → .vim/coc-settings.json

@ -2,7 +2,7 @@
"languageserver": {
"ccls": {
"command": "ccls",
"filetypes": ["c", "cpp", "objc", "objcpp"],
"filetypes": ["c", "c.doxygen", "cpp", "cpp.doxygen", "objc", "objcpp"],
"rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
"initializationOptions": {
"cache": {

201
.vim/vimrc

@ -0,0 +1,201 @@
" Move temporary files to a secure location to protect against CVE-2017-1000382
if exists('$XDG_CACHE_HOME')
let &g:directory=$XDG_CACHE_HOME
else
let &g:directory=$HOME . '/.cache'
endif
let &g:undodir=&g:directory . '/vim/undo//'
let &g:backupdir=&g:directory . '/vim/backup//'
let &g:directory.='/vim/swap//'
" Create directories if they doesn't exist
if ! isdirectory(expand(&g:directory))
silent! call mkdir(expand(&g:directory), 'p', 0700)
endif
if ! isdirectory(expand(&g:backupdir))
silent! call mkdir(expand(&g:backupdir), 'p', 0700)
endif
if ! isdirectory(expand(&g:undodir))
silent! call mkdir(expand(&g:undodir), 'p', 0700)
endif
filetype plugin on
syntax on
if $TERM isnot# 'linux'
set termguicolors
endif
if &compatible
set nocompatible
endif
set backspace=indent,eol,start
set breakindent breakindentopt=shift:2,sbr showbreak=
set clipboard=unnamed,exclude:cons\|linux
set diffopt+=iwhite
set foldmethod=syntax foldlevelstart=99
set history=1000
set hlsearch incsearch ignorecase smartcase
set iskeyword+=:
set linebreak
set list listchars=tab:\ \ ,extends:>,precedes:<
set modeline undofile
set mouse=a
set ruler showcmd title
set scrolloff=3 display=lastline
set shiftwidth=2 expandtab smarttab autoindent smartindent
set suffixes+=.aux,.bbl,.blg,.brf,.cb,.dvi,.idx,.ilg,.ind,.inx,.jpg,.log,.out,.png,.toc suffixes-=.h suffixes-=.obj
set t_EI=[1\ q t_SR=[3\ q t_SI=[5\ q t_Cs=[4:3m t_Ce=[4:0m t_CR= t_CG= t_CY= t_C0=
set ttimeout ttimeoutlen=100
set viminfofile=~/.vim/viminfo
set wildmenu wildmode=longest:full,full
let g:netrw_banner = 0
let g:python_recommended_style = 0
let g:tex_comment_nospell = 1
let g:tex_fold_enabled = 1
au FileType tex setlocal spell
au FileType python setlocal foldmethod=indent
au BufWritePre /tmp/* setlocal noundofile
au BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line('$') && &ft !~# 'commit'
\| exe 'normal! g`"'
\|endif
hi Error ctermbg=1 guibg=DarkRed
hi ErrorMsg ctermbg=1 guibg=DarkRed
hi Folded NONE ctermfg=14 guifg=Cyan
hi NonText guifg=DarkCyan
hi Pmenu ctermbg=6 guibg=DarkMagenta
hi PmenuSel ctermfg=0 ctermbg=13 guifg=Blue guibg=Magenta
hi SpellBad NONE cterm=undercurl guisp=Red start=t_Cs,t_CR stop=t_C0,t_Ce
hi SpellCap NONE cterm=undercurl guisp=Green start=t_Cs,t_CG stop=t_C0,t_Ce
hi SpellRare NONE cterm=undercurl guisp=Yellow start=t_Cs,t_CY stop=t_C0,t_Ce
hi Visual guibg=#403d3d
hi debugPC guibg=DarkBlue
hi manUnderline guifg=Green
hi manBold cterm=bold
command! DiffOrig vert new | set bt=nofile | r ++edit # |
\ 0d_ | diffthis | wincmd p | diffthis
runtime! ftplugin/man.vim
if executable('gdb')
packadd termdebug
endif
nmap <Leader>/ :noh<CR>
nmap Y y$
augroup Binary
au!
au BufReadPost * if &binary
au BufReadPost * silent %!xxd
au BufReadPost * set ft=xxd
au BufReadPost * endif
au BufWritePre * if &binary
au BufWritePre * silent %!xxd -r
au BufWritePre * endif
au BufWritePost * if &binary
au BufWritePost * silent %!xxd
au BufWritePost * set nomod
au BufWritePost * endif
augroup END
let s:plugins = {}
let s:plugins.EasyAlign = #{
\ url: 'junegunn/vim-easy-align',
\ }
function s:plugins.EasyAlign.setup()
xmap ga <Plug>(EasyAlign)
nmap ga <Plug>(EasyAlign)
let g:easy_align_delimiters = {
\ '/': #{
\ pattern: '//\+\|/\*\|\ \*',
\ delimiter_align: 'l',
\ ignore_groups: [],
\ },
\ '\': #{
\ pattern: '\\',
\ indentation: 'keep',
\ left_margin: 1,
\ delimiter_align: 'center',
\ ignore_groups: ['String', 'Comment'],
\ },
\ }
autocmd FileType markdown imap <buffer> <Bar> <Bar><Esc>m`gaip*<Bar>``A
endfunction
let s:plugins.tagbar = #{
\ if: executable('ctags'),
\ url: 'majutsushi/tagbar',
\ opts: #{ on_cmd: 'TagbarToggle' },
\ }
let s:plugins.vimtex = #{
\ if: executable('latexmk'),
\ url: 'lervag/vimtex',
\ }
function s:plugins.vimtex.setup()
let g:vimtex_compiler_latexmk = #{ build_dir: 'build' }
let g:vimtex_compiler_latexmk_engines = {'_': '-lualatex'}
if executable('llpp.inotify')
let g:vimtex_view_general_viewer = 'llpp.inotify'
endif
autocmd FileType tex inoremap <expr> <buffer> `` vimtex#imaps#wrap_math("``", '`')
endfunction
let s:plugins.coc = #{
\ if: executable('yarn'),
\ url: 'neoclide/coc.nvim',
\ opts: #{ branch: 'release' },
\ }
function s:plugins.coc.setup()
call coc#add_extension('coc-vimlsp', 'coc-tsserver', 'coc-snippets', 'coc-python', 'coc-json', 'coc-highlight')
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" coc-snippets:
let g:coc_snippet_next = '<c-j>'
let g:coc_snippet_prev = '<c-k>'
endfunction
let s:plugins.manman = #{
\ if: executable('man'),
\ url: 'baltitenger/manman',
\ }
let s:plug_new = 0
if !filereadable(expand('~/.vim/autoload/plug.vim')) && executable('curl')
echo 'Downloading vim-plug...'
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let s:plug_new = 1
endif
call plug#begin('~/.vim/plugged')
for plugin in values(s:plugins)
if !has_key(plugin, 'if') || plugin.if
if has_key(plugin, 'opts')
Plug plugin.url, plugin.opts
else
Plug plugin.url
endif
endif
endfor
call plug#end()
if s:plug_new
PlugInstall --sync
endif
for plugin in values(s:plugins)
if !has_key(plugin, 'if') || plugin.if
if has_key(plugin, 'setup')
call plugin.setup()
endif
endif
endfor
" vim: ts=2 sw=0 noet
Loading…
Cancel
Save