Skip to content

Commit

Permalink
Update dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
jubnzv committed Aug 12, 2020
1 parent 0b11a45 commit f978ac1
Show file tree
Hide file tree
Showing 17 changed files with 25,079 additions and 74 deletions.
1,509 changes: 1,509 additions & 0 deletions .config/bat/themes/gruvbox/gruvbox (Dark) (Hard) NDC.tmTheme

Large diffs are not rendered by default.

21,938 changes: 21,938 additions & 0 deletions .config/bat/themes/gruvbox/gruvbox (Dark) (Hard).sublime-theme

Large diffs are not rendered by default.

1,509 changes: 1,509 additions & 0 deletions .config/bat/themes/gruvbox/gruvbox (Dark) (Hard).tmTheme

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .config/i3/config
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exec --no-startup-id xrdb /home/jubnzv/.Xdefaults
exec --no-startup-id dunst
exec --no-startup-id udiskie -t
exec --no-startup-id bsetroot -solid "#282828"
exec --no-startup-id /home/jubnzv/.local/bin/keepassxc
exec --no-startup-id keepassxc
exec --no-startup-id xss-lock -- ~/.config/i3/lock.sh
exec --no-startup-id syncthing-gtk
exec --no-startup-id autorandr --change home
Expand Down Expand Up @@ -259,7 +259,7 @@ mode "$mode_exec_apps" {
bindsym 2 exec $APP_MATTERMOST; mode "default"
bindsym 3 exec --no-startup-id $APP_THUNDERBIRD; mode "default"
bindsym 4 exec --no-startup-id $APP_DISCORD; mode "default"
bindsym 5 exec --no-startup-id hexchat mode "default"
bindsym 5 exec --no-startup-id hexchat; mode "default"
bindsym 9 workspace $ws_0; exec $APP_TELEGRAM; \
exec $APP_MATTERMOST; \
exec $APP_THUNDERBIRD; \
Expand Down
1 change: 1 addition & 0 deletions .config/i3/rofi-configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ configs=(
"$HOME/.zshrc"
"$HOME/.config/nvim/init.vim"
"$HOME/.tmux.conf"
"$HOME/.ideavimrc"
"$HOME/.config/i3/config"
"$HOME/.config/polybar/config"
"$HOME/.config/ranger/rc.conf"
Expand Down
2 changes: 1 addition & 1 deletion .config/nvim/UltiSnips/cpp.snippets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
snippet prexec_time
snippet exectime
{
auto start__ = std::chrono::high_resolution_clock::now();
${0:${VISUAL}}
Expand Down
1 change: 1 addition & 0 deletions .config/nvim/UltiSnips/lex.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends c
6 changes: 6 additions & 0 deletions .config/nvim/UltiSnips/lua.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
snippet exectime
local __dbg_t = os.clock()
${0:${VISUAL}}
print(string.format("elapsed time1: %.2f\n", os.clock() - __dbg_t))
endsnippet

1 change: 1 addition & 0 deletions .config/nvim/UltiSnips/yacc.snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extends c
84 changes: 41 additions & 43 deletions .config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ let g:python3_host_prog = '/usr/bin/python3.8'
" {{{ Plugins
call plug#begin('~/.local/share/nvim/plugged')

Plug 'scrooloose/nerdtree' " A tree explorer plugin for vim
Plug 'kshenoy/vim-signature' " Extended marks support
Plug 'tpope/vim-eunuch' " Helpers for Shell
Plug 'tpope/vim-speeddating' " <C-a>/<C-x> for dates and timestamps
Expand All @@ -34,8 +33,12 @@ Plug 'jubnzv/vim-cursorword' " Highlight word under cursor
Plug 'tpope/vim-fugitive' " Git wrapper
Plug 'airblade/vim-gitgutter' " Shows git status on a gutter column
Plug 'cohama/agit.vim' " Git log viewer
" TODO: Consider mhinz/vim-signify as replacement
" Plug 'mhinz/vim-signify' " Shows diff on a gutter column
" A tree explorer plugin for vim
Plug 'ms-jpq/chadtree', {
\ 'branch': 'chad',
\ 'do': ':UpdateRemotePlugins'
\ }
Plug 'mbbill/undotree'
Plug 'sodapopcan/vim-twiggy' " Git branch management
Plug 'rhysd/git-messenger.vim' " Reveal the commit messages under the cursor
Plug 'mhinz/vim-grepper' " Ag wrapper that works with quickfix window. Useful in large codebases.
Expand All @@ -56,7 +59,8 @@ Plug 'Shougo/deoplete.nvim', {
\ }
Plug 'Shougo/deoplete-lsp' " Neovim's LSP Completion source for deoplete
Plug 'copy/deoplete-ocaml' " Asynchronous completion for OCaml based on merlin
Plug 'sbdchd/neoformat'
Plug 'ocaml/vim-ocaml' " Vim runtime files for OCaml
Plug 'jubnzv/virtual-types.nvim' " Shows type annotations in virtual text
" Native neovim LSP client
if has('nvim-0.5')
Plug 'neovim/nvim-lsp'
Expand All @@ -67,10 +71,10 @@ endif
if has('nvim-0.5')
Plug 'nvim-treesitter/nvim-treesitter'
endif
Plug 'jubnzv/DoxygenToolkit.vim'
Plug 'sbdchd/neoformat' " Integration with code formatters
Plug 'jubnzv/DoxygenToolkit.vim' " Doxygen utilities
Plug 'editorconfig/editorconfig-vim' " EditorConfig Vim Plugin
Plug 'ocaml/vim-ocaml' " Vim runtime files for OCaml
Plug 'jpalardy/vim-slime'
Plug 'jpalardy/vim-slime' " REPL integraion
Plug 'bfrg/vim-cpp-modern' " Extended Vim syntax highlighting for C and C++ (C++11/14/17/20)
Plug 'derekwyatt/vim-fswitch' " This Vim plugin will help switching between companion files
Plug 'rhysd/vim-clang-format' " Vim plugin for clang-format
Expand All @@ -91,8 +95,7 @@ Plug 'othree/xml.vim', { 'for': [ 'xml', 'html' ] }
Plug 'elzr/vim-json', {'for': ['json'] }
Plug 'MTDL9/vim-log-highlighting' " Syntax highlighting for generic log files in VIM
Plug 'Matt-Deacalion/vim-systemd-syntax'
Plug 'jubnzv/IEC.vim'
" Plug '~/Dev/IEC.vim/'
Plug 'jubnzv/IEC.vim' " IEC61131-3 plugin

" LLVM plugin
" See: https://github.com/llvm/llvm-project/tree/master/llvm/utils/vim
Expand Down Expand Up @@ -146,6 +149,11 @@ if !has('nvim')
set completepopup=height:10,width:60,highlight:Pmenu,border:off
endif

" Live Substitution
" if has('nvim')
" set inccommand=split
" endif

if has('nvim-0.4')
set termguicolors
set winblend=10 " Transparency for floating windows
Expand Down Expand Up @@ -610,29 +618,12 @@ set foldtext=CustomFoldText()
" }}}
" }}}

" {{{ NerdTREE
"" Check if NERDTree is open or active
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction

function! NERDTreeOpen()
if IsNERDTreeOpen()
:NERDTreeToggle
else
:NERDTreeFind
endif
endfunction
" {{{ CHADTree
nnoremap <A-0> <cmd>CHADopen<cr>
" }}}

map <silent> <A-0> :call NERDTreeOpen()<CR>
let NERDTreeQuitOnOpen=1
let NERDTreeIgnore=[
\ ".*\\.class$",
\ ".*\\.o$",
\ ".*\\.pyc$",
\ "depcomp$",
\ "install-sh$",
\ ]
" {{{ UndoTree
nnoremap <A-9> :UndotreeToggle<cr>
" }}}

" {{{ DirDiff
Expand Down Expand Up @@ -919,6 +910,7 @@ nnoremap <leader>lf :Neoformat<CR>
let g:neoformat_enabled_html = ['prettier']
let g:neoformat_enabled_css = ['prettier']
let g:neoformat_enabled_java = ['astyle']
let g:neoformat_enabled_python = ['autopep8']
let g:neoformat_enabled_ocaml = ['ocpindent']
let g:neoformat_enabled_lua = ['luaformatter']
Expand Down Expand Up @@ -982,7 +974,7 @@ let g:gitgutter_map_keys = 0

nmap [v <Plug>(GitGutterPrevHunk)
nmap ]v <Plug>(GitGutterNextHunk)
nmap <leader>vv <Plug>(GitGutterPreviewHunk)
nmap <localleader>v <Plug>(GitGutterPreviewHunk)
nmap <leader>v- <Plug>(GitGutterStageHunk)
nmap <leader>v_ <Plug>(GitGutterUndoHunk)
nmap <leader>vs :Gstatus<cr>
Expand Down Expand Up @@ -1050,8 +1042,6 @@ augroup c_cxx_group
au FileType c,cpp setlocal tw=80
" Remove debug prints created with snippets
au FileType c,cpp nnoremap <buffer><leader>rd :JbzRemoveDebugPrints<CR>
" Renaming with clang-rename
au FileType c,cpp nnoremap <buffer><leader>lr :py3f ~/.config/nvim/clang-rename.py<CR>
" Autoformatting with clang-format
au FileType c,cpp nnoremap <buffer><leader>lf :<C-u>JbzClangFormat<CR>
au FileType c,cpp vnoremap <buffer><leader>lf :JbzMyClangFormat<CR>
Expand Down Expand Up @@ -1111,7 +1101,7 @@ augroup python_group
augroup END
" }}}

" {{{ OCaml
" {{{ OCaml and other MLs
" Merlin
" See: https://github.com/ocaml/merlin/wiki/vim-from-scratch
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
Expand All @@ -1122,6 +1112,7 @@ augroup ocaml_group
au FileType ocaml inoremap <A-1> `
au FileType dune setlocal foldmethod=marker
au FileType ocaml nnoremap <buffer><leader>sC :JbzOpenSlimeREPL "utop"<CR>
au FileType ocaml setlocal tabstop=2 shiftwidth=2
au FileType ocaml,dune RainbowToggleOn

" Print types from .annot files.
Expand All @@ -1135,9 +1126,19 @@ augroup ocaml_group
" FSwitch associations
" au BufEnter *.ml let b:fswitchdst = 'mli' | let b:fswitchlocs = 'ifrel:/././'
" au BufEnter *.mli let b:fswitchdst = 'ml' | let b:fswitchlocs = 'ifrel:/././'
au BufEnter *.mly let b:fswitchdst = 'lexer.mll' | let b:fswitchlocs = 'ifrel:/././'
au BufEnter *.mll let b:fswitchdst = 'parser.mly' | let b:fswitchlocs = 'ifrel:/././'
augroup END

" PolyML sources
au BufNewFile,BufRead *.ML set ft=sml

" ML-Yacc & ML-Lex
au BufNewFile,BufRead *.grm set ft=sml
au BufNewFile,BufRead *.lex set ft=sml

" SML interfaces
au BufNewFile,BufRead *.sig set ft=sml
au BufEnter *.sig let b:fswitchdst = 'sml' | let b:fswitchlocs = 'ifrel:/././' | let b:fsnonewfiles = 1
au BufEnter *.sml let b:fswitchdst = 'sig' | let b:fswitchlocs = 'ifrel:/././' | let b:fsnonewfiles = 1
" }}}

" {{{ Racket
Expand All @@ -1155,15 +1156,12 @@ augroup END

" {{{ vimscript
let g:vim_indent_cont = 2

augroup vim_group
au!
au FileType vim setlocal sw=4 ts=4 expandtab
au FileType vim setlocal foldmethod=marker foldlevel=0 foldenable
au FileType vim nnoremap <silent><buffer> K <Esc>:help <C-R><C-W><CR>
au FileType help noremap <buffer> q :q<cr>
au Filetype help <buffer> wincmd L
au Filetype help <buffer> vert resize 80
augroup END
" }}}

Expand Down Expand Up @@ -1235,9 +1233,9 @@ au FileType json syntax match Comment +\/\/.\+$+

" {{{ Markdown
let g:markdown_fenced_languages = [
\'python', 'bash=sh', 'c', 'cpp', 'asm', 'go', 'ocaml',
\'cmake', 'diff', 'yaml', 'haskell', 'json', 'tex',
\'plantuml', 'html', 'sql', 'nix'
\'python', 'py=python', 'bash=sh', 'c', 'cpp', 'c++=cpp',
\'asm', 'go', 'ocaml', 'cmake', 'diff', 'yaml', 'haskell',
\'json', 'tex', 'plantuml', 'html', 'sql', 'nix'
\]
augroup markdown_group
au!
Expand Down
20 changes: 13 additions & 7 deletions .config/nvim/lua/lsp.lua
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
local api = vim.api
local diagnostic = require "diagnostic"
local virtualtypes = require "virtualtypes"
local M = {}

function on_attach_ocaml()
diagnostic.on_attach()
virtualtypes.on_attach()
end

function M.setup()
require'nvim_lsp'.clangd.setup{
on_attach=require'diagnostic'.on_attach,
cmd = { "clangd-10", "--background-index" }
--cmd = { "clangd-11", "--background-index" } -- TODO: latest clang-11 is not compatible with nvim-lsp
on_attach=diagnostic.on_attach,
cmd = { "clangd-10", "--background-index" }
}
require'nvim_lsp'.pyls.setup{
on_attach=require'diagnostic'.on_attach
on_attach=diagnostic.on_attach
}
require'nvim_lsp'.gopls.setup{
on_attach=require'diagnostic'.on_attach
on_attach=diagnostic.on_attach
}

require'nvim_lsp'.ocamllsp.setup{
on_attach=require'diagnostic'.on_attach
on_attach=on_attach_ocaml
}

-- LSP keymap
vim.api.nvim_exec([[
nnoremap <silent> gl <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
Expand Down
11 changes: 2 additions & 9 deletions .config/ranger/rc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -327,22 +327,15 @@ map } traverse
# Bookmarks
map gh cd ~
map gw cd ~/Work/
map gu cd ~/Uni/
map gs cd ~/Sources/
map gd cd ~/Dev/
map gD cd ~/Downloads/
map gff cd ~/Documents/
map gfu cd ~/Documents/C & UNIX/
map gfc cd ~/Documents/C & UNIX/
map gfx cd ~/Documents/C++/
map gfo cd ~/Documents/Ops/
map gfn cd ~/Documents/Networks/
map go cd ~/Org/
map gfm cd ~/Documents/ML/
map gn cd ~/Org/Notes/
map gb cd ~/Books/
map ga cd ~/Audio/
map gp cd ~/Pictures/
map gCS cd ~/.local/scripts/
map gCs cd ~/.config/systemd/user/
map gM cd /media/jubnzv/
map gm cd /mnt
map g<F1> cd /tmp
Expand Down
22 changes: 18 additions & 4 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,31 +1,45 @@
[commit]
gpgsign = true

[core]
filemode = false
editor = nvim
pager = diff-so-fancy | less --tabs=4 -RFX
quotePath = false

[diff]
tool = kitty

[difftool]
prompt = false
trustExitCode = true

[difftool "kitty"]
cmd = kitty +kitten diff $LOCAL $REMOTE

[alias]
open = !nvim `git-open.sh`
# Gitlab
# git glmr origin 5
glmr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
undo = reset --soft HEAD~1
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend
tree = log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
# Github review
# git review 4
review= "!f() { git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# Gitlab review
# git review-gitlab origin 5
review-gitlab = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -

[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process

[github]
user = jubnzv

[user]
name = Georgy Komarov
email = jubnzv@gmail.com

[includeIf "gitdir:~/Work/*"]
path = ~/.gitconfig.work
Loading

0 comments on commit f978ac1

Please sign in to comment.