1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-07 18:15:11 +01:00

60 Commits

Author SHA1 Message Date
c59ec2687a Do not hide latex symbols 2021-04-10 12:58:24 +02:00
b2fa6f46c6 20201027: attempt at supporting more Markdown in todo files 2021-03-26 12:42:15 +01:00
26d268249c 20201027: attempt at supporting more Markdown in todo files 2021-03-26 12:40:53 +01:00
0243aa351b Word 2021-03-21 14:05:19 +01:00
be22ae5d26 YCM has a vim-legacy branch now 2021-02-17 10:01:09 +01:00
afdc46f09a Regular :Files already shows preview, bind to Git Files; also show open buffers 2021-01-20 12:49:14 +01:00
071c48f38a Hello 2021 2021-01-11 10:50:33 +01:00
b5ebbe1c68 YouCompleteMe has some pretty high vim version requirement... 2021-01-08 09:01:39 +01:00
0084ea18ef Disabled EmojiOne fallback font, it makes Telegram crash 2020-12-06 15:51:18 +01:00
5bf9bc00d8 virtualfish is needed to have virtualenvwrapper magic work in fish 2020-11-16 13:31:30 +01:00
23b7a4daa7 A word a day 2020-10-26 13:22:04 +01:00
1a95a6dd3b Handy function to send push notification after long job 2020-10-25 16:15:07 +01:00
dd536a69af Removed old vimwiki config; more wiki.vim goodness 2020-10-25 15:36:06 +01:00
cacfcb08f1 Lightweight vimwiki alternative 2020-10-23 12:01:25 +02:00
08f6b4e4e6 Better support for theming in gvim 2020-10-23 11:53:19 +02:00
a7adbb5b10 Plugin from main fzf repository is needed 2020-10-19 14:18:35 +02:00
7f3e2231c7 New word 2020-08-27 22:18:30 +02:00
3450865acb Alias bat so it works for batcat 2020-08-20 10:46:35 +02:00
88f0f0a17a Updated to latest download method from website 2020-08-11 14:34:45 +02:00
d989e45356 Add yaml frontmatter support to markdown highlighting 2020-08-07 11:13:04 +02:00
3bb8761460 Merge branch 'master' of github.com:aquatix/dotfiles 2020-07-21 20:24:38 +02:00
0d82d4d81f You know, the fairytale park 2020-07-21 20:24:22 +02:00
0b76113602 Use colours in ip output 2020-07-08 15:18:19 +02:00
8dc6017b69 Default strategy for reconciling divergent branches 2020-05-25 10:19:23 +02:00
4e8c3dd959 Fixed actual ssh command 2020-05-16 22:08:48 +02:00
c06f82b8ca Use function instead of alias to fix tab completion 2020-05-11 20:29:42 +02:00
f88987b88a More info on vim configs; subheaders for subsections 2020-05-01 12:17:04 +02:00
9ef543c20e Global Git ignore file 2020-04-24 20:33:00 +02:00
303ab65529 Word 2020-04-22 14:17:19 +02:00
75579a8876 Removed old install method for virtualfish, replaced by vf install 2020-04-22 13:28:45 +02:00
e3541e9ed3 Only use these directories when regular user 2020-03-09 15:36:48 +01:00
53b8eb72de Disable vimwiki for now, it's not really needed 2020-03-09 15:34:03 +01:00
09e74b2046 vimwiki dev handles markdown links better, also on-enter linkgen 2020-03-02 14:43:07 +01:00
9098575694 Ignore some useless 'text'files; include journal into search 2020-02-26 16:40:25 +01:00
e2763c0df9 Quickly search, open, and create notes 2020-02-26 15:34:11 +01:00
1057af7db0 vimwiki-markdown HTML generation settings 2020-02-24 21:30:21 +01:00
4b99c54002 Clarifications 2020-02-24 15:43:48 +01:00
6c600f6483 Introducing vimwiki, because it does a lot of stuff I want 2020-02-24 15:42:07 +01:00
28dbd2d064 Useful Git aliases 2020-02-22 11:21:31 +01:00
16bd3d8597 Script to move a file preserving Git history, rewriting history in the process 2020-02-22 11:21:25 +01:00
81d7996635 Soooo, include to file extension dot to actually match 2020-02-20 22:41:17 +01:00
f5b83256c0 Use vim default clipboard 2020-02-18 16:07:58 +01:00
cf5886795f Useful :TrimWhitespace command to trim trailing spaces and such 2020-02-11 15:22:25 +01:00
aac84dffbc Whitelist some common text files, so others get opened externally 2020-02-11 15:22:02 +01:00
8d0ddd2be1 Default markdown list indentation to 2 instead of 4 2020-01-29 13:59:53 +01:00
6e68b27156 Do not include hidden files, as it will include ignored, like Git files 2020-01-29 13:59:33 +01:00
e4bb09e1d8 Changed to branch with more fixes, like Pelican links 2020-01-28 11:10:48 +01:00
77c90d11ac Follow links from Markdown files 2020-01-28 10:24:29 +01:00
7497d196f0 Merge branch 'master' of github.com:aquatix/dotfiles 2020-01-26 21:22:26 +01:00
0f27d68eee Hm, how could it not know these? 2020-01-26 21:22:08 +01:00
f5395c2eb5 Enable a better fzf/ripgrep search-in-files command 2020-01-23 21:24:10 +01:00
28d1836e6f JetBrains Mono font 2020-01-20 08:53:45 +01:00
0fcc3f8e45 Newer way of installing fisher package manager 2020-01-15 21:31:38 +01:00
b8a69a86ec Also ignore plugged dir; fix for limelight muted colours 2020-01-11 11:45:16 +01:00
54c57a0a7c Merge branch 'master' of github.com:aquatix/dotfiles 2020-01-11 10:23:46 +01:00
6ee26a97d3 Switched to 'reversed' variant, which has nicer grey accents 2020-01-11 10:23:09 +01:00
53e64f6aca Disable bufferline for now, as it interferes with showing messages 2020-01-11 10:13:51 +01:00
4f4b0c4461 Markdown preview opens vertical split by default now 2020-01-09 11:49:43 +01:00
7d238fa747 Markdown preview plugin, using https://github.com/MichaelMure/mdr 2020-01-08 22:06:57 +01:00
6163103b82 It's 2020! 2020-01-08 09:36:11 +01:00
17 changed files with 346 additions and 34 deletions

View File

@@ -22,6 +22,11 @@ alias lll='ls --color=always -alF | less -R'
# append history instead of overwriting: # append history instead of overwriting:
shopt -s histappend shopt -s histappend
if command -v batcat &> /dev/null; then
# Sometimes `bat` has the binary `batcat`, like on Debian or Ubuntu
alias bat='batcat'
fi
alias findphp='find . -name "*.php" | xargs grep --color=auto' alias findphp='find . -name "*.php" | xargs grep --color=auto'
alias findjs='find . -name "*.js" | xargs grep --color=auto' alias findjs='find . -name "*.js" | xargs grep --color=auto'
alias findcss='find . -name "*.css" | xargs grep --color=auto' alias findcss='find . -name "*.css" | xargs grep --color=auto'

View File

@@ -7,12 +7,9 @@ if not functions -q fisher
echo "Installing fisher for the first time..." >&2 echo "Installing fisher for the first time..." >&2
set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
fisher fish -c fisher
end end
# Virtualenv support with virtualfish
eval (python3 -m virtualfish compat_aliases)
# Theme options for bobthefish # Theme options for bobthefish
set -g theme_nerd_fonts yes set -g theme_nerd_fonts yes
set -g theme_show_exit_status yes set -g theme_show_exit_status yes
@@ -58,6 +55,9 @@ set -gx FZF_DEFAULT_COMMAND 'rg --files --no-ignore --hidden --follow --glob "!.
set -gx FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND" set -gx FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
set -gx FZF_ALT_C_COMMAND "$FZF_DEFAULT_COMMAND" set -gx FZF_ALT_C_COMMAND "$FZF_DEFAULT_COMMAND"
# Set HOSTNAME to the hostname of the device, without trailing domain name
set -x HOSTNAME (hostname | string split -m1 '.')[1]
# Aliases # Aliases
## Listing ## Listing
alias ll 'ls -alF' alias ll 'ls -alF'
@@ -84,7 +84,10 @@ alias gt 'git tag|less'
alias ffnightly 'env MOZ_USE_XINPUT2=1 /usr/local/bin/firefoxnightly/firefox' alias ffnightly 'env MOZ_USE_XINPUT2=1 /usr/local/bin/firefoxnightly/firefox'
## SSH, for compatibility, as our terminfo now is non-standard 'tmux-256color-italic' in tmux ## SSH, for compatibility, as our terminfo now is non-standard 'tmux-256color-italic' in tmux
alias ssh 'env TERM=xterm-256color ssh' #alias ssh 'env TERM=xterm-256color ssh'
function ssh
env TERM=screen-256color ssh $argv
end
## Grepping ## Grepping
alias findfile 'find . | grep -v .svn | grep -v .hg | grep -v .git | grep' alias findfile 'find . | grep -v .svn | grep -v .hg | grep -v .git | grep'
@@ -98,11 +101,16 @@ function grepl
grep --color=always -ir $argv | less -R grep --color=always -ir $argv | less -R
end end
# Sometimes `bat` has the binary `batcat`, like on Debian or Ubuntu
alias bat (command -v batcat || echo bat)
function rgl function rgl
rg -p $argv | less -RFX rg -p $argv | less -RFX
end end
## Various ## Various
alias ip 'ip -c'
#alias tmux 'tmux -2' #alias tmux 'tmux -2'
alias tmux_reload "tmux source-file ~/.tmux.conf" alias tmux_reload "tmux source-file ~/.tmux.conf"
alias tmux_takeover "tmux detach -a" alias tmux_takeover "tmux detach -a"
@@ -128,6 +136,24 @@ function rgvim
end end
end end
function imready
# Get return status and run time of last command, to be used with long-running jobs
# e.g.: longrunning.sh; imready
set laststatus $status
if test $status = 0
set result "success"
else
set result "failed with result $laststatus"
end
set duration (echo "$CMD_DURATION 1000" | awk '{printf "%.3fs", $1 / $2}')
set resulttext "Result of command: $result (took: $duration)"
# Send a push message with summary
if test -f "$HOME/workspace/projects/others/pushover.sh/pushover.sh"
$HOME/workspace/projects/others/pushover.sh/pushover.sh -t "[$HOSTNAME] command finished" "$resulttext"
end
end
function jl function jl
# Pretty print the json file used as argument, and feed it in colour to less # Pretty print the json file used as argument, and feed it in colour to less
jq -C --indent 2 . $argv | less -R jq -C --indent 2 . $argv | less -R

View File

@@ -33,11 +33,17 @@
# list aliases # list aliases
la = "!git config -l | grep alias | cut -c 7-" la = "!git config -l | grep alias | cut -c 7-"
# git change-commits GIT_COMMITTER_NAME "old name" "new name"
change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f "
# from https://help.github.com/articles/remove-sensitive-data
remove-file = "!f() { git filter-branch -f --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all; }; f"
[push] [push]
default = simple default = simple
[core] [core]
editor = vim editor = vim
excludesfile = ~/.gitignore_global
[diff] [diff]
wsErrorHighlight = all wsErrorHighlight = all
@@ -57,3 +63,5 @@
[url "git://bitbucket.org/"] [url "git://bitbucket.org/"]
insteadOf = "bitbucket:" insteadOf = "bitbucket:"
[pull]
rebase = false

6
.gitignore_global Normal file
View File

@@ -0,0 +1,6 @@
# vim
*.swp
*.swo
# virtualenv
.venv

View File

@@ -1 +1,2 @@
set ideajoin set ideajoin
set clipboard+=unnamed

View File

@@ -0,0 +1,3 @@
unlet b:current_syntax
syntax include @Yaml syntax/yaml.vim
syntax region yamlFrontmatter start=/\%^---$/ end=/^---$/ keepend contains=@Yaml

View File

@@ -1 +1,2 @@
au BufNewFile,BufRead *.todo set filetype=todo au BufNewFile,BufRead *.todo set filetype=todo
"au BufNewFile,BufRead *.todo set filetype=markdown

View File

@@ -149,3 +149,13 @@ tweaken
dammIT dammIT
YouTube YouTube
berenhap berenhap
inlegzooltjes
Chromebook
KlikAanKlikUit
Mandalorian
knuffelbaar
gewokte
Efteling
wokgerecht
rundersaucijs
Loïs

Binary file not shown.

View File

@@ -2,6 +2,11 @@ if exists("b:current_syntax")
finish finish
endif endif
runtime! syntax/html.vim
unlet! b:current_syntax
"runtime! syntax/markdown.vim
"unlet! b:current_syntax
" Keywords that we want to emphasize " Keywords that we want to emphasize
"syntax keyword todoKeyword todo done important "syntax keyword todoKeyword todo done important
@@ -85,6 +90,19 @@ highlight todoTitledItem ctermfg=172 guifg=#d78700
syntax match todoItem '[a-zA-Z0-9\-_]\+:' contained syntax match todoItem '[a-zA-Z0-9\-_]\+:' contained
highlight todoItem ctermfg=Blue guifg=#87d7ff highlight todoItem ctermfg=Blue guifg=#87d7ff
syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
highlight link todoStatusDone PreProc highlight link todoStatusDone PreProc
highlight link todoStatusDoing PreProc highlight link todoStatusDoing PreProc
highlight link todoStatusCancelled PreProc highlight link todoStatusCancelled PreProc
@@ -93,6 +111,18 @@ highlight link todoStatusTodo PreProc
highlight link todoStatusImportant PreProc highlight link todoStatusImportant PreProc
highlight link todoStatusQuestion PreProc highlight link todoStatusQuestion PreProc
hi def link markdownLinkText htmlLink
hi def link markdownIdDeclaration Typedef
hi def link markdownId Type
hi def link markdownAutomaticLink markdownUrl
hi def link markdownUrl Float
hi def link markdownUrlTitle String
hi def link markdownIdDelimiter markdownLinkDelimiter
hi def link markdownUrlDelimiter htmlTag
hi def link markdownUrlTitleDelimiter Delimiter
" runtime! syntax/markdown.vim
" unlet! b:current_syntax
" Syntax highlighting scheme name " Syntax highlighting scheme name
let b:current_syntax = "todo" let b:current_syntax = "todo"

96
.vimrc
View File

@@ -52,7 +52,8 @@ let g:airline_theme = "hybrid"
" Disable showing current function in airline " Disable showing current function in airline
let g:airline#extensions#tagbar#enabled = 0 let g:airline#extensions#tagbar#enabled = 0
" Better showing of open buffers (open files), integrates with airline " Better showing of open buffers (open files), integrates with airline
Plug 'bling/vim-bufferline' " Plug 'bling/vim-bufferline'
" Plug 'alisnic/vim-bufferline'
" Version control notes in the line number bar " Version control notes in the line number bar
if has('nvim') || has('patch-8.0.902') if has('nvim') || has('patch-8.0.902')
@@ -140,6 +141,7 @@ endif
" fzf integration for fast fuzzy finding, better and faster than ctrl-p " fzf integration for fast fuzzy finding, better and faster than ctrl-p
set rtp+=~/workspace/projects/others/fzf set rtp+=~/workspace/projects/others/fzf
set rtp+=/data/data/com.termux/files/usr/bin/fzf set rtp+=/data/data/com.termux/files/usr/bin/fzf
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
" Customize fzf colors to match your color scheme " Customize fzf colors to match your color scheme
@@ -164,29 +166,35 @@ let g:fzf_colors =
" https://medium.com/@crashybang/supercharge-vim-with-fzf-and-ripgrep-d4661fc853d2 " https://medium.com/@crashybang/supercharge-vim-with-fzf-and-ripgrep-d4661fc853d2
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0) command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
" Alternative, not enabled for the moment, as it also searches part of the " Search contents of files with ripgrep
" file name " https://sidneyliebrand.io/blog/how-fzf-and-ripgrep-improved-my-workflow
command! -bang -nargs=* Rg command! -bang -nargs=* Rg
\ call fzf#vim#grep( \ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(<q-args>), 1, \ 'rg --column --line-number --smart-case --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%') \ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'), \ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'),
\ <bang>0) \ <bang>0)
" Files command with preview window " Files command with preview window
command! -bang -nargs=? -complete=dir FilesPreview command! -bang -nargs=? -complete=dir FilesPreview
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0) \ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
" Mapping the above functions to more easily accessible hotkeys.
" Simply type ; to search through buffers, leader-o to search through file " Simply type ; to search through buffers, leader-o to search through file
" names, leader-O to search through file names, showing a preview window, " names, leader-O to search through file names, showing a preview window,
" \t for tags, \c for (Git) commits and \f to search through contents of files " \t for tags, \c for (Git) commits and \f to search through contents of files
nmap ; :Buffers<CR> nmap ; :Buffers<CR>
nmap <Leader>o :Files<CR> nmap <Leader>o :Files<CR>
nmap <Leader>O :FilesPreview<CR> "nmap <Leader>O :FilesPreview<CR>
" Git files, takes .gitignore into account
nmap <Leader>O :GFiles<CR>
nmap <Leader>b :Buffers<CR>
nmap <Leader>t :Tags<CR> nmap <Leader>t :Tags<CR>
nmap <Leader>c :Commits<CR> nmap <Leader>c :Commits<CR>
nmap <Leader>f :Find<CR> " nmap <Leader>f :Find<CR>
nmap <Leader>f :Rg<CR>
nmap <Leader>l :Lines<CR> nmap <Leader>l :Lines<CR>
" nmap <Leader>g :Rg<CR>
nnoremap <silent> [f :lprevious<CR> nnoremap <silent> [f :lprevious<CR>
nnoremap <silent> ]f :lnext<CR> nnoremap <silent> ]f :lnext<CR>
@@ -196,9 +204,8 @@ nnoremap <silent> ]f :lnext<CR>
" https://github.com/ryanoasis/nerd-fonts " https://github.com/ryanoasis/nerd-fonts
Plug 'ryanoasis/vim-devicons' Plug 'ryanoasis/vim-devicons'
" Set guifont when using gvim: " Set guifont when using gvim:
"set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11 set guifont=Hack\ Nerd\ Font\ Mono\ 10
"
" undotree.vim : Display your undo history in a graph. " undotree.vim : Display your undo history in a graph.
Plug 'mbbill/undotree' Plug 'mbbill/undotree'
nnoremap <Leader>u :UndotreeToggle<CR> nnoremap <Leader>u :UndotreeToggle<CR>
@@ -278,6 +285,8 @@ Plug 'Yggdroot/indentLine'
let g:indentLine_char = '┊' let g:indentLine_char = '┊'
"let g:indentLine_setConceal = 0 "let g:indentLine_setConceal = 0
let g:indentLine_conceallevel = 1 let g:indentLine_conceallevel = 1
" Do not conceal LaTeX symbols
let g:tex_conceal=""
" Colour-match brackets " Colour-match brackets
Plug 'luochen1990/rainbow' Plug 'luochen1990/rainbow'
@@ -308,7 +317,14 @@ if !filereadable(skip_ycm) " Only load YouCompleteMe if ~/.dot_no_ycm does not
" sudo apt-get install python-dev " sudo apt-get install python-dev
" cd ~/.vim/bundle/YouCompleteMe " cd ~/.vim/bundle/YouCompleteMe
" ./install.py # For C-style languages: ./install.py --clang-completer " ./install.py # For C-style languages: ./install.py --clang-completer
if has('patch-8.1.2269')
" Latest YCM needs at least this version of vim
Plug 'ycm-core/YouCompleteMe' Plug 'ycm-core/YouCompleteMe'
else
" Version compatible with the vim in Debian 10 buster
" Plug 'ycm-core/YouCompleteMe', { 'commit':'d98f896' }
Plug 'ycm-core/YouCompleteMe', { 'branch':'legacy-vim' }
endif
" YouCompleteMe interpreter version (should be the same as what YCM was " YouCompleteMe interpreter version (should be the same as what YCM was
" compiled with): " compiled with):
if filereadable('/data/data/com.termux/files/usr/bin/python3') if filereadable('/data/data/com.termux/files/usr/bin/python3')
@@ -393,10 +409,51 @@ let g:vim_markdown_folding_disabled = 1
set nofoldenable set nofoldenable
let g:vim_markdown_conceal = 0 let g:vim_markdown_conceal = 0
let g:vim_markdown_conceal_code_blocks = 0 let g:vim_markdown_conceal_code_blocks = 0
let g:vim_markdown_new_list_item_indent = 2
Plug 'godlygeek/tabular' Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown' Plug 'plasticboy/vim-markdown'
" Use filetype name as fenced code block languages for syntax highlighting " Use filetype name as fenced code block languages for syntax highlighting
let g:vim_markdown_fenced_languages = ['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini', 'python=python'] let g:vim_markdown_fenced_languages = ['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini', 'python=python']
" Preview markdown files with :PreviewMarkdown - needs mdr from
" https://github.com/MichaelMure/mdr
Plug 'skanehira/preview-markdown.vim'
let g:preview_markdown_vertical = 1
" Navigate through and from markdown files
"Plug 'chmp/mdnav'
Plug 'aquatix/mdnav', { 'branch': 'fixes' }
" Only open these local files in vim, use pyfile for all others:
let g:mdnav#Extensions = '.md, .MD, .markdown, .todo, .txt, .rst'
" wiki.vim
Plug 'lervag/wiki.vim'
" let g:wiki_root = '~/wiki'
let g:wiki_root = '~/phren'
let g:wiki_filetypes = ['md']
let g:wiki_link_extension = '.md'
let g:wiki_link_target_type = 'md'
" let g:wiki_mappings_use_defaults = 1
"support for #tag style tags instead of :tag:
let g:wiki_tags_format_pattern = '\v%(^|\s)#\zs[^# ]+'
" number of lines from the top to scan for tags
let g:wiki_tags_scan_num_lines = 500
" search through the tags in the wiki
nmap <leader>wf :WikiFzfTags <CR>
" find backlinks to this document
nmap <leader>wb :WikiGraphFindBacklinks <CR>
" find in ToC/structure of the (markdown) file
nmap <leader>ft :WikiFzfToc <CR>
if $USER != 'root'
" notational velocity with fzf: quickly search and open notes
Plug 'https://github.com/alok/notational-fzf-vim'
let g:nv_search_paths = ['~/phren', '~/mydocs', '~/.dot/caplog']
let g:nv_ignore_pattern = ['*.xml', '*.svg']
" Quickly open the search with this shortcut
nmap <leader>n :NV <CR>
endif
" The NERD Commenter: A plugin that allows for easy commenting of code for " The NERD Commenter: A plugin that allows for easy commenting of code for
@@ -432,7 +489,7 @@ au BufNewFile,BufRead *.j2,*.jinja2 set ft=jinja
Plug 'ludovicchabant/vim-gutentags' Plug 'ludovicchabant/vim-gutentags'
" know when Gutentags is generating tags (prints 'TAGS' in status-line) " know when Gutentags is generating tags (prints 'TAGS' in status-line)
set statusline+=%{gutentags#statusline()} set statusline+=%{gutentags#statusline()}
let g:gutentags_ctags_exclude = ["*.min.*", "build", ".bundle", ".git", "log", "node_modules", "tmp", "vendor", "*.vim/bundle/*"] let g:gutentags_ctags_exclude = ["*.min.*", "build", ".bundle", ".git", "log", "node_modules", "tmp", "vendor", "*.vim/bundle/*", "*.vim/plugged/*"]
"let g:gutentags_trace = 1 "let g:gutentags_trace = 1
@@ -446,6 +503,8 @@ let g:goyo_width = 120
Plug 'junegunn/limelight.vim' Plug 'junegunn/limelight.vim'
let g:limelight_conceal_ctermfg = 'Grey69' let g:limelight_conceal_ctermfg = 'Grey69'
let g:limelight_conceal_ctermfg = 145 let g:limelight_conceal_ctermfg = 145
" Color name (:help gui-colors) or RGB color
let g:limelight_conceal_guifg = '#b0b0b0'
" Helps with writing prose (better line breaks, agnostic on soft line wraps vs " Helps with writing prose (better line breaks, agnostic on soft line wraps vs
" hard line breaks etc) " hard line breaks etc)
@@ -481,6 +540,14 @@ set listchars=tab:▸\ ,trail:·
" Display whitespace " Display whitespace
set list set list
" Trim trailing whitespace with :TrimWhitespace
fun! TrimWhitespace()
let l:save = winsaveview()
keeppatterns %s/\s\+$//e
call winrestview(l:save)
endfun
command! TrimWhitespace call TrimWhitespace()
" enable words completion " enable words completion
set dictionary+=/usr/share/dict/words set dictionary+=/usr/share/dict/words
" use ctrl-n ctrl-n instead of ctrl-x ctrl-k " use ctrl-n ctrl-n instead of ctrl-x ctrl-k
@@ -510,17 +577,20 @@ set hidden
set cryptmethod=blowfish2 set cryptmethod=blowfish2
" Ensure 256 colour support if the terminal supports it " Ensure 256 colour support if the terminal supports it
if &term == "xterm" || &term == "xterm-256color" || &term == "screen-bce" || &term == "screen-256color" || &term == "screen" || &term == "tmux-256color-italic" if has("gui_running") || &term == "xterm" || &term == "xterm-256color" || &term == "screen-bce" || &term == "screen-256color" || &term == "screen" || &term == "tmux-256color-italic"
set background=dark set background=dark
let g:enable_bold_font = 1 let g:enable_bold_font = 1
let g:enable_italic_font = 1 let g:enable_italic_font = 1
let g:hybrid_transparent_background = 1 let g:hybrid_transparent_background = 1
colorscheme hybrid_material colorscheme hybrid_reverse
" create a bar for airline " create a bar for airline
set laststatus=2 set laststatus=2
let g:airline_powerline_fonts = 1 let g:airline_powerline_fonts = 1
" ensure black background in gvim
highlight Normal guibg=black
endif endif
" This is what sets vim to use 24-bit colors. It will also work for any version of neovim " This is what sets vim to use 24-bit colors. It will also work for any version of neovim

View File

@@ -13,8 +13,12 @@ cd dotfiles # this takes you to the freshly cloned ~/.dot/dotfiles
sh install.sh # follow the instructions and install the files in the homedir sh install.sh # follow the instructions and install the files in the homedir
``` ```
Extra's:
# Dependency on `fzf` and ripgrep `rg` [virtualfish](https://virtualfish.readthedocs.io/en/latest/install.html) for virtualenv(wrapper) integration in `fish` shell.
## Dependency on `fzf` and ripgrep `rg`
Both the shell configuration and vim make use of `fzf`. [fzf is a general-purpose command-line fuzzy finder](https://github.com/junegunn/fzf) and helps one 'grep' really fast through filenames. It's an alternative for the well-known `find`. Install it by cloning the repository and running the install script ([check the Installation notes too](https://github.com/junegunn/fzf#installation)). Both the shell configuration and vim make use of `fzf`. [fzf is a general-purpose command-line fuzzy finder](https://github.com/junegunn/fzf) and helps one 'grep' really fast through filenames. It's an alternative for the well-known `find`. Install it by cloning the repository and running the install script ([check the Installation notes too](https://github.com/junegunn/fzf#installation)).
@@ -23,11 +27,19 @@ Both the shell configuration and vim make use of `fzf`. [fzf is a general-purpos
If your distribution does not provide a package, [get yours from the releases page](https://github.com/BurntSushi/ripgrep/releases) (there's a .deb for 64-bit systems). If your distribution does not provide a package, [get yours from the releases page](https://github.com/BurntSushi/ripgrep/releases) (there's a .deb for 64-bit systems).
# Fix for shift+F6 in tmux (and screen probably) ## vim config
The [.vimrc](https://github.com/aquatix/dotfiles/blob/master/.vimrc) has a lot going on. [Find out more about my tweaks](https://dammit.nl/tag/vim.html) and use `:Maps` in vim itself to see key mappings
vim uses both `fzf` and `rg`, and also really likes having `ctags` (Exuberant Ctags) available.
## Fix for shift+F6 in tmux (and screen probably)
In tmux, do `infocmp > screen-256color`. Add the line `kf16=\E[17;2~,` and compile the file with tic. This will result in `~/.terminfo/s/screen-256color` with the correct keycode for shift+F6. `.tmux.conf` needs the line `setw -g xterm-keys on` for it to register correctly. In tmux, do `infocmp > screen-256color`. Add the line `kf16=\E[17;2~,` and compile the file with tic. This will result in `~/.terminfo/s/screen-256color` with the correct keycode for shift+F6. `.tmux.conf` needs the line `setw -g xterm-keys on` for it to register correctly.
# ~/.git_repos config file
## ~/.git_repos config file
The `update_repos` script takes the `~/.git_repos` config file and lets you update and clone your projects automatically (or at least in a batch). In the example the first four repos are located in ~/workspace/projects/github, and the other two in workspace/projects/others and workspace/projects/private respectively; then the workspace and group are empty, so mydocs is cloned into the homedir. At the moment, only paths relative to the user's homedir are supported. The `update_repos` script takes the `~/.git_repos` config file and lets you update and clone your projects automatically (or at least in a batch). In the example the first four repos are located in ~/workspace/projects/github, and the other two in workspace/projects/others and workspace/projects/private respectively; then the workspace and group are empty, so mydocs is cloned into the homedir. At the moment, only paths relative to the user's homedir are supported.
@@ -51,7 +63,8 @@ group=
ssh://myserver/srv/git/mydocs.git ssh://myserver/srv/git/mydocs.git
``` ```
# Interesting scripts
## Interesting scripts
| ./bin/ | description | | ./bin/ | description |
|------------------|-----------------------------------------------------------------------------------------| |------------------|-----------------------------------------------------------------------------------------|
@@ -60,7 +73,7 @@ ssh://myserver/srv/git/mydocs.git
| clean_project | Remove compiled Python files, vim swp files | | clean_project | Remove compiled Python files, vim swp files |
| clean_pyc | Remove compiled Python files | | clean_pyc | Remove compiled Python files |
| fixpermissions | chmod dirs to 755, files to 644 | | fixpermissions | chmod dirs to 755, files to 644 |
| fixpictimestamps | Change file ctime to datetime from EXIF | | fixpictimestamps | Change file ctime to datetime from EXIF using exiftool |
| fontupdate | Update nerd-fonts; whole repo on server, link font files to ~/.local/share/fonts | | fontupdate | Update nerd-fonts; whole repo on server, link font files to ~/.local/share/fonts |
| fuz | Simple note-taking 'app' based on FZF and vim | | fuz | Simple note-taking 'app' based on FZF and vim |
| git_autosave | Simple script to call from crontab or something to commit certain files in Git and push | | git_autosave | Simple script to call from crontab or something to commit certain files in Git and push |

View File

@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
sudo -v && wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()" sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin

View File

@@ -46,6 +46,15 @@ overpass-semibold.otf
overpass-thin-italic.otf overpass-thin-italic.otf
overpass-thin.otf' overpass-thin.otf'
FONTS_JETBRAINS=$'JetBrainsMono-Bold-Italic.ttf
JetBrainsMono-Bold.ttf
JetBrainsMono-ExtraBold-Italic.ttf
JetBrainsMono-ExtraBold.ttf
JetBrainsMono-Italic.ttf
JetBrainsMono-Medium-Italic.ttf
JetBrainsMono-Medium.ttf
JetBrainsMono-Regular.ttf'
FONTS_GO=$'Go-Bold-Italic.ttf FONTS_GO=$'Go-Bold-Italic.ttf
Go-Bold.ttf Go-Bold.ttf
Go-Italic.ttf Go-Italic.ttf
@@ -67,7 +76,7 @@ Rubik-Medium.ttf
Rubik-Regular.ttf' Rubik-Regular.ttf'
# https://github.com/eosrei/emojione-color-font/ # https://github.com/eosrei/emojione-color-font/
FONTS_VARIOUS=$'EmojiOneColor-SVGinOT.ttf' # FONTS_VARIOUS=$'EmojiOneColor-SVGinOT.ttf'
FONTS_DELETE=$'Sauce Code Pro Medium Plus Nerd File Types Plus Font Awesome Plus Octicons Plus Pomicons.ttf FONTS_DELETE=$'Sauce Code Pro Medium Plus Nerd File Types Plus Font Awesome Plus Octicons Plus Pomicons.ttf
Sauce Code Pro Bold Plus Nerd File Types Mono Plus Font Awesome Plus Octicons Plus Pomicons.ttf Sauce Code Pro Bold Plus Nerd File Types Mono Plus Font Awesome Plus Octicons Plus Pomicons.ttf
@@ -97,6 +106,21 @@ if [ -e ~/.dot_is_server ]; then
echo "$SOURCE_DIR or $DEST_DIR not found, aborting" echo "$SOURCE_DIR or $DEST_DIR not found, aborting"
fi fi
# Update from the repo
echo "== Jetbrains Mono ======"
SOURCE_DIR="/stuff/system/fonts/JetBrainsMono/ttf"
DEST_DIR="/stuff/system/sync/fonts/active"
if [ -d "$SOURCE_DIR" ] && [ -d "$DEST_DIR" ]; then
cd "$SOURCE_DIR"
git pull --all
while read -r FONT; do
echo "Copied font: $FONT"
cp -a "$SOURCE_DIR/$FONT" "$DEST_DIR"
done <<< "$FONTS_JETBRAINS"
else
echo "$SOURCE_DIR or $DEST_DIR not found, aborting"
fi
# Update from the repo # Update from the repo
echo "== Overpass ======" echo "== Overpass ======"
SOURCE_DIR="/stuff/system/fonts/Overpass/desktop-fonts/overpass" SOURCE_DIR="/stuff/system/fonts/Overpass/desktop-fonts/overpass"
@@ -140,6 +164,9 @@ else
FONT_FILE=$(basename "${SOURCE_DIR}/${FONT}") FONT_FILE=$(basename "${SOURCE_DIR}/${FONT}")
install_font "$SOURCE_DIR/$FONT_FILE" "$DEST_DIR/$FONT_FILE" install_font "$SOURCE_DIR/$FONT_FILE" "$DEST_DIR/$FONT_FILE"
done <<< "$FONTS_CODING" done <<< "$FONTS_CODING"
while read -r FONT; do
install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT"
done <<< "$FONTS_JETBRAINS"
while read -r FONT; do while read -r FONT; do
install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT" install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT"
done <<< "$FONTS_FUTURA" done <<< "$FONTS_FUTURA"
@@ -152,14 +179,15 @@ else
while read -r FONT; do while read -r FONT; do
install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT" install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT"
done <<< "$FONTS_RUBIK" done <<< "$FONTS_RUBIK"
while read -r FONT; do # while read -r FONT; do
install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT" # install_font "$SOURCE_DIR/$FONT" "$DEST_DIR/$FONT"
done <<< "$FONTS_VARIOUS" # done <<< "$FONTS_VARIOUS"
if [ ! -e "${HOME}/.config/fontconfig" ]; then if [ ! -e "${HOME}/.config/fontconfig" ]; then
mkdir -p "${HOME}/.config/fontconfig" mkdir -p "${HOME}/.config/fontconfig"
fi fi
if [ ! -e "${HOME}/.config/fontconfig/fonts.conf" ]; then if [ -L "${HOME}/.config/fontconfig/fonts.conf" ]; then
ln -s "${SOURCE_DIR}/fonts.conf" "${HOME}/.config/fontconfig/" # Remove the emoji-fallback config that causes crashes in Telegram Desktop (symlink)
rm "${HOME}/.config/fontconfig/fonts.conf"
fi fi
# Delete obsolete fonts # Delete obsolete fonts
while read -r FONT; do while read -r FONT; do

111
bin/gitmv Executable file
View File

@@ -0,0 +1,111 @@
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
#
# https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F
#
# While the above sucks, git has the ability to let you rewrite history
# of anything via `filter-branch`. This utility just wraps that functionality,
# but also allows you to easily specify more than one rename/move at a
# time (since the `filter-branch` can be slow on big repos).
#
# Usage:
#
# git-rewrite-history [-d/--dry-run] [-v/--verbose] <srcname>=<destname> <...> <...>
#
# After the repsitory is re-written, eyeball it, commit and push up.
#
# Given this example repository structure:
#
# src/makefile
# src/test.cpp
# src/test.h
# src/help.txt
# README.txt
#
# The command:
#
# git-rewrite-history README.txt=README.md \ <-- rename to markdpown
# src/help.txt=docs/ \ <-- move help.txt into docs
# src/makefile=src/Makefile <-- capitalize makefile
#
# Would restructure and retain history, resulting in the new structure:
#
# docs/help.txt
# src/Makefile
# src/test.cpp
# src/test.h
# README.md
#
# @author emiller
# @date 2013-09-29
# @url https://gist.github.com/tupy/79ec62fee769d4049db2
#
function usage() {
echo "usage: `basename $0` [-d/--dry-run] [-v/--verbose] <srcname>=<destname> <...> <...>"
[ -z "$1" ] || echo $1
exit 1
}
[ ! -d .git ] && usage "error: must be ran from within the root of the repository"
dryrun=0
filter=""
verbose=""
repo=$(basename `git rev-parse --show-toplevel`)
while [[ $1 =~ ^\- ]]; do
case $1 in
-d|--dry-run)
dryrun=1
;;
-v|--verbose)
verbose="-v"
;;
*)
usage "invalid argument: $1"
esac
shift
done
for arg in $@; do
val=`echo $arg | grep -q '=' && echo 1 || echo 0`
src=`echo $arg | sed 's/\(.*\)=\(.*\)/\1/'`
dst=`echo $arg | sed 's/\(.*\)=\(.*\)/\2/'`
dir=`echo $dst | grep -q '/$' && echo $dst || dirname $dst`
[ "$val" -ne 1 ] && usage
[ ! -e "$src" ] && usage "error: $src does not exist"
filter="$filter \n\
if [ -e \"$src\" ]; then \n\
echo \n\
if [ ! -e \"$dir\" ]; then \n\
mkdir -p ${verbose} \"$dir\" && echo \n\
fi \n\
mv $verbose \"$src\" \"$dst\" \n\
fi \n\
"
done
[ -z "$filter" ] && usage
if [[ $dryrun -eq 1 || ! -z $verbose ]]; then
echo
echo "tree-filter to execute against $repo:"
echo -e "$filter"
fi
[ $dryrun -eq 0 ] && git filter-branch -f --tree-filter "`echo -e $filter`"

View File

@@ -2,4 +2,4 @@
cd ~/mydocs/work/divault cd ~/mydocs/work/divault
git pull git pull
#vim -c ":vsp planning_2015.todo" notes_2015.md notes_2014.md #vim -c ":vsp planning_2015.todo" notes_2015.md notes_2014.md
vim -c "set nofoldenable" planning_2019.todo notes.md vim -c "set nofoldenable" planning_2021.todo notes.md

View File

@@ -87,7 +87,7 @@ DATETIME=$(date +%Y%m%d_%H%M)
cd || exit cd || exit
# Symlink all the things # Symlink all the things
for TARGET in .bash_aliases .bashrc bin .gitconfig .gitmodules .hgauthors.txt .hgignore .hgrc .ideavimrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh for TARGET in .bash_aliases .bashrc bin .gitconfig .gitignore_global .gitmodules .hgauthors.txt .hgignore .hgrc .ideavimrc .ignore .screenrc .terminfo .tmux.conf .vim .vimrc install.sh
do do
make_link $DIR $TARGET make_link $DIR $TARGET
done done