From 37ff7062874b72bafa99afe661f42653565ed511 Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Wed, 11 Sep 2024 04:25:38 +0900 Subject: RESTRUCTURE. Replicate relative paths in public/ --- public/.config/git/config | 15 ++ public/.config/git/ignore | 10 + public/.config/gtk-3.0/settings.ini | 15 ++ public/.config/intellijidea/ideavimrc | 51 +++++ public/.config/locale.conf | 5 + public/.config/mpv/mpv.conf | 5 + public/.config/nsxiv/exec/image-info | 21 ++ public/.config/nsxiv/exec/thumb-info | 20 ++ public/.config/nvim/colors/mac_classic.vim | 226 +++++++++++++++++++++ public/.config/nvim/ftplugin/tex.vim | 1 + public/.config/nvim/init.vim | 193 ++++++++++++++++++ public/.config/nvim/pack/mitsuo/Readme.txt | 1 + .../.config/nvim/pack/mitsuo/start/fun/Readme.txt | 1 + .../nvim/pack/mitsuo/start/fun/plugin/fun.vim | 121 +++++++++++ .../.config/nvim/pack/mitsuo/start/vim-commentary | 1 + public/.config/pandoc/linuxcolors_style.html | 188 +++++++++++++++++ public/.config/ssh/Readme.txt | 8 + public/.config/ssh/config | 9 + public/.config/ssh/sshd_config | 117 +++++++++++ public/.config/tmux/tmux.conf | 66 ++++++ public/.config/vscode/Readme.adoc | 7 + public/.config/vscode/keybindings.json | 58 ++++++ public/.config/vscode/settings.json | 14 ++ public/.config/zathura/zathurarc | 59 ++++++ 24 files changed, 1212 insertions(+) create mode 100644 public/.config/git/config create mode 100644 public/.config/git/ignore create mode 100644 public/.config/gtk-3.0/settings.ini create mode 100644 public/.config/intellijidea/ideavimrc create mode 100644 public/.config/locale.conf create mode 100644 public/.config/mpv/mpv.conf create mode 100755 public/.config/nsxiv/exec/image-info create mode 100755 public/.config/nsxiv/exec/thumb-info create mode 100644 public/.config/nvim/colors/mac_classic.vim create mode 100644 public/.config/nvim/ftplugin/tex.vim create mode 100644 public/.config/nvim/init.vim create mode 100644 public/.config/nvim/pack/mitsuo/Readme.txt create mode 100644 public/.config/nvim/pack/mitsuo/start/fun/Readme.txt create mode 100644 public/.config/nvim/pack/mitsuo/start/fun/plugin/fun.vim create mode 160000 public/.config/nvim/pack/mitsuo/start/vim-commentary create mode 100644 public/.config/pandoc/linuxcolors_style.html create mode 100644 public/.config/ssh/Readme.txt create mode 100644 public/.config/ssh/config create mode 100644 public/.config/ssh/sshd_config create mode 100644 public/.config/tmux/tmux.conf create mode 100644 public/.config/vscode/Readme.adoc create mode 100644 public/.config/vscode/keybindings.json create mode 100644 public/.config/vscode/settings.json create mode 100644 public/.config/zathura/zathurarc (limited to 'public/.config') diff --git a/public/.config/git/config b/public/.config/git/config new file mode 100644 index 0000000..ec672da --- /dev/null +++ b/public/.config/git/config @@ -0,0 +1,15 @@ +[user] + email = rtokumori@pucp.edu.pe + name = Mitsuo Tokumori +[diff] + # used with $ git difftool + tool = nvim -d + submodule = log +[merge] + tool = nvim -d +[gitweb] + owner = Mitsuo Tokumori +[init] + defaultBranch = master +[pull] + ff = only diff --git a/public/.config/git/ignore b/public/.config/git/ignore new file mode 100644 index 0000000..81f3e57 --- /dev/null +++ b/public/.config/git/ignore @@ -0,0 +1,10 @@ +# gitconfig file in ~/.config/git/config (if not in ~/.gitconfig) + +# Vim +*.swp + +# KDE +.directory + +# Python +config.py diff --git a/public/.config/gtk-3.0/settings.ini b/public/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..7033423 --- /dev/null +++ b/public/.config/gtk-3.0/settings.ini @@ -0,0 +1,15 @@ +[Settings] +gtk-application-prefer-dark-theme=false +gtk-button-images=true +gtk-cursor-theme-name=breeze_cursors +gtk-cursor-theme-size=24 +gtk-decoration-layout=icon:minimize,maximize,close +gtk-enable-animations=true +gtk-font-name=Noto Sans, 12 +gtk-icon-theme-name=breeze +gtk-menu-images=true +gtk-modules=colorreload-gtk-module:window-decorations-gtk-module +gtk-primary-button-warps-slider=false +gtk-theme-name=Breeze +gtk-toolbar-style=3 +gtk-xft-dpi=98304 diff --git a/public/.config/intellijidea/ideavimrc b/public/.config/intellijidea/ideavimrc new file mode 100644 index 0000000..c746971 --- /dev/null +++ b/public/.config/intellijidea/ideavimrc @@ -0,0 +1,51 @@ +"" Source your .vimrc +"source ~/.vimrc + +"" -- Suggested options -- +" Show a few lines of context around the cursor. Note that this makes the +" text scroll if you mouse-click near the start or end of the window. +set scrolloff=5 + +" Do incremental searching. +set incsearch + +" Don't use Ex mode, use Q for formatting. +"map Q gq + + +"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t +"" Map \r to the Reformat Code action +"map \r (ReformatCode) + +"" Map d to start debug +"map d (Debug) + +"" Map \b to toggle the breakpoint on the current line +"map \b (ToggleLineBreakpoint) + + +" Find more examples here: https://jb.gg/share-ideavimrc + +""" My stuff +set hlsearch +set ignorecase +set smartcase +set showmode +nnoremap :nohl +nnoremap :tabp +nnoremap :tabn + +""" IdeaVim options +" Join and justify paragraphs/lines +set ideajoin " smartjoin +vnoremap gq :action FillParagraph +" Thank you: https://stackoverflow.com/a/37842786/7498073 +" TIP: Got the action name by listing all actions that contain the word fill +" `:actionlist fill` +"set ideamarks + +""" Plugins +" Couldn't make it to work well :( +" https://github.com/abrookins/WrapToColumn +" vnoremap gq :action com.andrewbrookins.idea.wrap.WrapParagraphAction + diff --git a/public/.config/locale.conf b/public/.config/locale.conf new file mode 100644 index 0000000..b827928 --- /dev/null +++ b/public/.config/locale.conf @@ -0,0 +1,5 @@ +LANG=C.UTF-8 +LC_COLLATE=C.UTF-8 +LC_MEASUREMENT=ja_JP.UTF-8 +LC_TIME=ja_JP.UTF-8 +LC_PAPER=ja_JP.UTF-8 diff --git a/public/.config/mpv/mpv.conf b/public/.config/mpv/mpv.conf new file mode 100644 index 0000000..23b612d --- /dev/null +++ b/public/.config/mpv/mpv.conf @@ -0,0 +1,5 @@ +# ~/.config/mpv/mpv.conf + +# Screenshots +screenshot-template="%f-%P" +screenshot-directory="~/media/Pictures/Screenshots/mpv" diff --git a/public/.config/nsxiv/exec/image-info b/public/.config/nsxiv/exec/image-info new file mode 100755 index 0000000..5f06123 --- /dev/null +++ b/public/.config/nsxiv/exec/image-info @@ -0,0 +1,21 @@ +#!/bin/sh + +# Example for $XDG_CONFIG_HOME/nsxiv/exec/image-info +# Called by nsxiv(1) whenever an image gets loaded. +# The output is displayed in nsxiv's status bar. +# Arguments: +# $1: path to image file (as provided by the user) +# $2: image width +# $3: image height +# $4: fully resolved path to the image file + +s=" " # field separator + +exec 2>/dev/null + +filename=$(basename -- "$1") +filesize=$(du -Hh -- "$1" | cut -f 1) +geometry="${2}x${3}" + +echo "${filesize}${s}${geometry}${s}${filename}" + diff --git a/public/.config/nsxiv/exec/thumb-info b/public/.config/nsxiv/exec/thumb-info new file mode 100755 index 0000000..b422f9c --- /dev/null +++ b/public/.config/nsxiv/exec/thumb-info @@ -0,0 +1,20 @@ +#!/bin/sh + +# Example for $XDG_CONFIG_HOME/nsxiv/exec/thumb-info +# Called by nsxiv(1) whenever the selected thumbnail changes. +# The output is displayed in nsxiv's status bar. +# Arguments: +# $1: path to image file (as provided by the user) +# $2: empty +# $3: empty +# $4: fully resolved path to the image file + +s=" " # field separator + +exec 2>/dev/null + +filename=$(basename -- "$4") +filesize=$(du -Hh -- "$4" | cut -f 1) + +echo "${filesize}${s}${filename}" + diff --git a/public/.config/nvim/colors/mac_classic.vim b/public/.config/nvim/colors/mac_classic.vim new file mode 100644 index 0000000..9382bde --- /dev/null +++ b/public/.config/nvim/colors/mac_classic.vim @@ -0,0 +1,226 @@ +" Vim color scheme +" +" Name: mac_classic.vim +" Maintainer: Drew Neil +" License: public domain +" Version: 0.1 + +" Boilerplate: {{{1 +set background=light +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "mac_classic" + + +" Colors: {{{1 +" TODO figure out how to not highlight TODO +" +" #000000 +" #3C4C72 - BLUE/GREY - cursor, rails helpers +" #0000A2 - D.BLUE - numbers & function names +" #1E39F6 - BLUE +" #0066FF - L.BLUE - Comments, TODOs and folds +" #6E79F1 - L.PURPLE - Booleans, Ruby Constants & CSS definitions +" #318495 - BLUE/GREEN - Ruby instance/global/pseudo variables +" #007B22 - D.GREEN - Strings, Labels and code blocks in Markdown +" #00BC41 - L.GREEN - CSS common attributes & ruby interpolation +" #990000 - BURGUNDY - Errors and Warnings +" #D51015 - RED for constants, symbols, numbers +" #E18AC7 - PINK RegularExpressions in Ruby +" #FFCE77 - ORANGE - Incremental Search +" #FFE6BB - L.ORANGE - Search +" #C6DEFF - VL.BLUE Visual, Current StatusLine & AutoComplete selection +" #808080 - Line numbers +" #CFCFCF - VerticalSplit separator +" #DFDFDF - Invisible Characters +" #EFEFEF - LineNumber & Non-Current StatusLine +" #F0F6FF - CursorLine & CursorColumn +" #FFFFFF - WHITE +" }}} + +" GUI: {{{1 +hi Cursor guifg=#FFFFFF ctermfg=15 guibg=#3C4C72 ctermbg=240 +hi Visual guibg=#C6DEFF ctermbg=189 +hi CursorLine guibg=#F0F6FF ctermbg=15 +hi CursorColumn guibg=#F0F6FF ctermbg=15 +hi LineNr guifg=#808080 ctermfg=244 guibg=#EFEFEF ctermbg=7 +hi VertSplit guifg=#FFFFFF ctermfg=15 guibg=#CFCFCF ctermbg=252 gui=NONE +hi MatchParen guifg=#1E39F6 ctermfg=27 guibg=NONE gui=bold +hi Pmenu guibg=#EFEFEF ctermbg=7 +hi PmenuSel guibg=#C6DEFF ctermbg=189 +hi Directory guifg=#D51015 ctermfg=160 gui=bold +hi Folded guifg=#0066FF ctermfg=27 guibg=#FFFFFF ctermbg=15 +" StatusLine: {{{2 +hi StatusLine guifg=#000000 ctermfg=0 guibg=#C6DEFF ctermbg=189 gui=italic +hi StatusLineNC guifg=#000000 ctermfg=0 guibg=#EFEFEF ctermbg=7 gui=NONE + +" Search: {{{2 +" [IncSearch is stronger than Search] +hi IncSearch guifg=NONE guibg=#FFCE77 ctermbg=222 gui=NONE +hi Search guibg=#FFE6BB ctermbg=223 + +" Syntax: {{{1 +hi Normal guifg=#000000 ctermfg=0 guibg=#FFFFFF ctermbg=15 +hi Boolean guifg=#6E79F1 ctermfg=69 gui=bold +hi Character guifg=#D51015 ctermfg=160 gui=bold +hi Comment guifg=#0066FF ctermfg=27 gui=italic +hi Conditional guifg=#1E39F6 ctermfg=27 gui=bold +hi Constant guifg=#D51015 ctermfg=160 gui=bold +hi Define guifg=#1E39F6 ctermfg=27 gui=bold +hi ErrorMsg guifg=#FFFFFF ctermfg=15 guibg=#990000 ctermbg=88 +hi WarningMsg guifg=#FFFFFF ctermfg=15 guibg=#990000 ctermbg=88 +hi Float guifg=#0000A2 ctermfg=19 +hi Function guifg=#0000A2 ctermfg=19 gui=bold +hi Identifier guifg=#1E39F6 ctermfg=27 gui=bold +hi Keyword guifg=#1E39F6 ctermfg=27 gui=bold +hi Label guifg=#007B22 ctermfg=28 +hi Number guifg=#0000A2 ctermfg=19 +hi Operator guifg=#1E39F6 ctermfg=27 gui=bold +hi PreProc guifg=#1E39F6 ctermfg=27 gui=bold +hi Special guifg=#000000 ctermfg=0 +hi Statement guifg=#1E39F6 ctermfg=27 gui=bold +hi StorageClass guifg=#1E39F6 ctermfg=27 gui=bold +hi String guifg=#007B22 ctermfg=28 +hi Title guifg=#000000 ctermfg=0 gui=bold +hi Todo guifg=#0066FF ctermfg=27 gui=inverse,bold,italic +hi Underlined gui=underline + +" Invisible character colors +hi NonText guifg=#DFDFDF ctermfg=253 guibg=#FFFFFF ctermbg=15 +hi SpecialKey guifg=#DFDFDF ctermfg=253 guibg=#FFFFFF ctermbg=15 + +" Diff styles {{{1 +hi diffAdded guifg=#007B22 guibg=#FFFFFF ctermfg=28 ctermbg=15 +hi diffRemoved guifg=#D51015 guibg=#FFFFFF ctermfg=160 ctermbg=15 +hi diffFile guifg=#6E79F1 guibg=#FFFFFF ctermfg=69 ctermbg=15 +hi diffNewFile guifg=#6E79F1 guibg=#FFFFFF ctermfg=69 ctermbg=15 +hi diffLine guifg=#000000 guibg=#FFFFFF ctermfg=0 ctermbg=15 + +hi diffAdd guifg=#007B22 guibg=#FFFFFF ctermfg=28 ctermbg=15 +hi diffChange guifg=#007B22 guibg=#FFFFFF ctermfg=28 ctermbg=15 +hi diffText guifg=#007B22 guibg=#FFFFFF ctermfg=28 ctermbg=15 +hi link diffDelete diffRemoved +" Git styles {{{1 +hi gitcommitFirstLine guifg=#000000 guibg=#FFFFFF ctermfg=0 ctermbg=15 +hi gitcommitSelectedType guifg=#007B22 guibg=#FFFFFF ctermfg=28 ctermbg=15 +hi link gitcommitSelectedFile gitcommitSelectedType +hi gitcommitDiscardedType guifg=#D51015 guibg=#FFFFFF ctermfg=160 ctermbg=15 +hi link gitcommitDiscardedFile gitcommitDiscardedType +hi gitcommitUntrackedFile guifg=#6E79F1 guibg=#FFFFFF ctermfg=69 ctermbg=15 +" Ruby styles {{{1 +hi rubyClass guifg=#1E39F6 ctermfg=27 gui=bold +hi rubyFunction guifg=#0000A2 ctermfg=19 gui=bold +hi rubyInterpolationDelimiter guifg=#00BC41 ctermfg=35 +hi rubyInterpolation guifg=#00BC41 ctermfg=35 +hi rubySymbol guifg=#D51015 ctermfg=160 gui=bold +hi rubyConstant guifg=#6E79F1 ctermfg=69 gui=bold +hi rubyStringDelimiter guifg=#007B22 ctermfg=28 +hi rubyInstanceVariable guifg=#318495 ctermfg=66 +hi rubyInclude guifg=#1E39F6 ctermfg=27 gui=bold +hi rubyGlobalVariable guifg=#318495 ctermfg=66 +hi rubyRegexp guifg=#E18AC7 ctermfg=176 +hi rubyRegexpAnchor guifg=#E18AC7 ctermfg=176 +hi rubyRegexpQuantifier guifg=#E18AC7 ctermfg=176 +hi rubyRegexpParens guifg=#E18AC7 ctermfg=176 +hi rubyRegexpEscape guifg=#00BC41 ctermfg=35 +hi rubyRegexpCharClass guifg=#00BC41 ctermfg=35 +hi rubyRegexpDelimiter guifg=#E18AC7 ctermfg=176 +hi rubyEscape guifg=#00BC41 ctermfg=35 +hi rubyControl guifg=#1E39F6 ctermfg=27 gui=bold +hi rubyOperator guifg=#1E39F6 ctermfg=27 gui=bold +hi rubyException guifg=#1E39F6 ctermfg=27 gui=bold +hi rubyPseudoVariable guifg=#318495 ctermfg=66 +hi rubyRailsUserClass guifg=#6E79F1 ctermfg=69 gui=bold +hi rubyRailsARAssociationMethod guifg=#3C4C72 ctermfg=240 gui=bold +hi rubyRailsARMethod guifg=#3C4C72 ctermfg=240 gui=bold +hi rubyRailsRenderMethod guifg=#3C4C72 ctermfg=240 gui=bold +hi rubyRailsMethod guifg=#3C4C72 ctermfg=240 gui=bold +hi link erubyComment Comment +hi erubyRailsMethod guifg=#3C4C72 ctermfg=240 gui=bold + +" XML: {{{1 +hi link xmlEndTag xmlTag +" HTML: {{{1 +hi htmlTag guifg=#1E39F6 ctermfg=27 +hi link htmlEndTag htmlTag +hi link htmlTagName htmlTag +hi link htmlArg htmlTag +hi htmlSpecialChar guifg=#D51015 ctermfg=160 gui=bold +hi htmlH1 gui=bold +hi link htmlH2 htmlH1 +hi link htmlH3 htmlH1 +hi link htmlH4 htmlH1 +hi link htmlH5 htmlH1 +hi link htmlH6 htmlH1 + +" JavaScript: {{{1 +hi javaScriptFunction guifg=#1E39F6 ctermfg=27 gui=bold +hi javaScriptFuncName guifg=#318495 ctermfg=66 gui=italic +hi javaScriptLabel guifg=#0000A2 ctermfg=19 gui=bold +hi javaScriptRailsFunction guifg=#3C4C72 ctermfg=240 gui=bold +hi javaScriptType guifg=#318495 ctermfg=66 gui=none +hi javaScriptArgument guifg=#318495 ctermfg=66 gui=italic +hi javaScriptRegexpString guifg=#E18AC7 ctermfg=176 gui=NONE +hi javaScriptSpecial guifg=#00BC41 ctermfg=35 gui=NONE +" NOTE: Syntax Highlighting for javascript doesn't match the +" TextMate version very accurately, because the javascript +" syntax file does not create matches for some items. In +" particular: +" * javaScriptArgument - e.g. function(argument) +" * javaScriptFuncName for object literal style functions - e.g.: +" myFunction: function() { ... } + +" YAML: {{{1 +hi yamlAnchor guifg=#318495 ctermfg=66 +hi yamlAlias guifg=#318495 ctermfg=66 +hi yamlDocumentHeader guibg=#F2F2F2 ctermbg=7 + +" CSS: {{{1 +hi cssTagName gui=bold +hi cssIdentifier gui=italic +hi link cssClassName cssIdentifier +hi cssDefinition guifg=#6E79F1 ctermfg=69 +hi link cssRenderProp cssDefinition +hi link cssTextProp cssDefinition +hi link cssFontProp cssDefinition +hi link cssColorProp cssDefinition +hi link cssBoxProp cssDefinition +hi link cssGeneratedContentProp cssDefinition +hi link cssUIProp cssDefinition +hi cssCommonAttr guifg=#00BC41 ctermfg=35 +hi link cssAttr cssCommonAttr +hi link cssRenderAttr cssCommonAttr +hi link cssTextAttr cssCommonAttr +hi link cssFontAttr cssCommonAttr +hi link cssGeneratedContentAttr cssCommonAttr +hi cssURL guifg=#007B22 ctermfg=28 +hi cssFunctionName guifg=#3C4C72 ctermfg=240 gui=bold +hi cssColor guifg=#D51015 ctermfg=160 gui=bold +hi cssValueLength guifg=#0000A2 ctermfg=19 +hi cssImportant guifg=#1E39F6 ctermfg=27 gui=bold + +" Vimscript: {{{1 +hi vimGroup guifg=#007B22 ctermfg=28 gui=bold +hi link vimHiGroup vimGroup +hi vimCommentTitle guifg=#3C4C72 ctermfg=240 gui=bold +hi helpSpecial guifg=#6E79F1 ctermfg=69 + +" Markdown: {{{1 +hi markdownBold gui=bold +hi markdownItalic gui=italic +hi markdownCode guifg=#007B22 ctermfg=28 +hi link markdownCodeBlock markdownCode + +" Outliner: {{{1 +hi BT1 guifg=#808080 ctermfg=244 gui=italic +hi OL1 guifg=#000000 ctermfg=0 gui=bold +hi OL2 guifg=#0000A2 ctermfg=19 gui=bold +hi OL3 guifg=#007B22 ctermfg=28 gui=bold +hi OL4 guifg=#6E79F1 ctermfg=69 gui=NONE +" Modelines: {{{1 +" vim: nowrap fdm=marker +" }}} diff --git a/public/.config/nvim/ftplugin/tex.vim b/public/.config/nvim/ftplugin/tex.vim new file mode 100644 index 0000000..e005eb1 --- /dev/null +++ b/public/.config/nvim/ftplugin/tex.vim @@ -0,0 +1 @@ +nnoremap :!build-latex.sh % diff --git a/public/.config/nvim/init.vim b/public/.config/nvim/init.vim new file mode 100644 index 0000000..c6d2bb3 --- /dev/null +++ b/public/.config/nvim/init.vim @@ -0,0 +1,193 @@ +" NeoVim init.vim +" +" Differences with good ol' Vim: +" +" NeoVim has so many of the modern and helpful Vim options on by default. I'll +" remove most of the old Vim configurations that now come by default in NeoVim. +" +" Also NeoVim uses XDG directories by default, keeping a clean directory tree. +" +" NeoVim also allows for this file to be written in Lua. I'll stick to using +" Vim script becuase it has more documentation and is more concise configuring +" Vim options. +" +" Instead of viminfo, NeoVim uses shada files (SHared DAta) (different format). +" See shada-file-name. +" +" For some reason, as of version v0.8.3 of NeoVim, Vim internal codes for shift- +" and control- function keys change in NeoVim. changes to , and +" changes to . See https://github.com/neovim/neovim/issues/7384 +" +" Plugins: There are a lot of ways to install "plug-in"s in Vim. My prefered +" way is using Vim packages, available since Vim version 8. See packages. +" +" Tips: +" * To show navigate help files: +" K " while on an option to see it's documentation +" CTRL-] " navigation while on a Vim help file +" * To re-indent: +" tab->spaces :set tabstop=n :set expandtab :retab +" spaces->tab :set noexpandtab :set tabstop={softtabstop} :retab! +" * To justify: +" To 'justify' comments or block of text (paragraph) use `gq{motion}` or +" `gp{motion}`, where {motion} can be `[/`, `]/`, `ip`, `i{`, `a{`. +" * To see the last page of previous command: +" `g<` +" * Buffer stuff: +" :ls " shows all buffers +" :b N " Go to buffer N (integer) + + +" Settings +" ---------------------------------------------------------------------- + +" Common +colorscheme industry +filetype plugin on + +" Command line: +set cmdheight=1 +set wildmenu +set wildignore+=*.o,.git,*.class +set path+=./**30 " For gf and :find, add all subdirectories relative to + " current file (30 max) to the "search space" + +" Search +set ignorecase +set smartcase + +" Screen +set nonumber +set scrolloff=5 " show a few lines of context +set colorcolumn=+1 " show ruler at position tabstop+1 +set laststatus=2 +" Add buffer number to the default status line with ruler +set statusline=%<%f\ %h%m%r%=b%02n\ \ %-14.(%l,%c%V%)\ %P + +" TODO: move to ftplugin +" TODO: create tags automatically (:!ctags -R . after :w if ft=c) +" Tag Jumping +" Instructions: create tag index (e.g. $ ctags -R .) +" place cursor on tag +" ^] to jump to definition +" g^] if more than 1 definition +" ^T to return (or ^O) + +"set cindent +"set cinoptions=:0,g0 " See C-indenting + + +" Indentation: 4 spaces +" See also: autoindent, smartindent, cindent, indentexpr +set tabstop=4 " Each '\t' takes 8 virtual (screen) columns +set shiftwidth=0 " (Auto)indentation. Also affects: >>, i_C-T, i_C-D +set expandtab " Expand inserted s with +set smartindent " Smart indenting when starting a new line + +" Formatting: See fo-table +set formatoptions+=t " auto-wrap text (when inserting) +set formatoptions+=c " auto-wrap comments (when inserting) +set formatoptions+=q " Allow formatting of comments with "gq" +set formatoptions+=j " Removes comment leader when joining lines +set formatoptions+=l " Don't break long lines that are already typed +set formatoptions+=r " Insert current leader after in Insert mode +set formatoptions+=p " Don't break honorifics like Prof. Smith +set formatoptions+=n " Recognize numbered lists +set formatoptions+=o " Automatically insert the current comment + " leader after `o`. + +" Wrap: Auto-break lines longer than 80 colums +set textwidth=80 +set wrap +set linebreak " Don't break words + +" Mouse +set mouse=a " Enable mouse for all modes + +" Buffers +set hidden " Allow for hidden modified buffers + +" Split +set splitbelow splitright + + +" Mappings +" ---------------------------------------------------------------------- + +let $VIMFILES = split(&rtp, ",")[0] + +map :source $VIMFILES/init.vim +map :e $VIMFILES/init.vim + +map :tabp +map :tabn +map :bNext +map :bnext + +" TODO: move to ftplugin +" C/C++ Programming: +map :w:!clear && make +"map :!./%:r +"map :!./a.out +map :cnext +map :cprev +" "Run cTags" +map rt :!ctags -R . +map :tnext +" Motion to go to beggining of function while cursor is inside +nmap [f [m[{k0 + +" pandoc (& website): +nnoremap mm :w:Md2Html +nmap mM mm:!updatewebsite_zaz + +" asciidoctor: +nnoremap ma :w:!asciidoctor % +nmap mA ma:!updatewebsite.sh + +" Funcionallity of the following depends on terminal emulator. Needs 8-bit +" input enabled +" for = Alt key combos +" From: https://vim.fandom.com/wiki/Get_Alt_key_to_work_in_terminal +nmap h +nmap j +nmap k +nmap l + +" Go Title Case (and clear highlighted matches) +" Ref.: https://vim.fandom.com +vmap gt :s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g + +" Autoformat JSON jumbled data +" Ref.: https://stackoverflow.com/questions/26214156/how-to-auto-format-json-on-save-in-vim +nnoremap gJ :%!python3 -m json.tool + +" Replaces previous WORD arithmetic expression with result (from Vim +" fandom-wiki) +inoremap diWi=" + + +" Views and Sessions (Window layout and Line folding) +" ---------------------------------------------------------------------- +" It is possible to create folds automatically but idk how to do it. +" :mkview so save them :loadview to load them (zo open one, zc close one, +" zR to open all, zM to close all, zx to restore)) + +" Views saves folds. Sessions saves all windows configuration and layout +" Load Sessions with $ vim -S Session.vim + +" To automatically save and restore views for *.c *.cpp files: +"au BufWinLeave *.c mkview +"au BufWinEnter *.c silent loadview +"au BufWinLeave *.cpp mkview +"au BufWinEnter *.cpp silent loadview + + +" Playground +" ---------- +"autocmd FileType tex nnoremap :!./build.sh % + +"augroup TeX +" autocmd! +" autocmd BufWritePost *.tex !./build.sh % +"augroup END diff --git a/public/.config/nvim/pack/mitsuo/Readme.txt b/public/.config/nvim/pack/mitsuo/Readme.txt new file mode 100644 index 0000000..a9e88cd --- /dev/null +++ b/public/.config/nvim/pack/mitsuo/Readme.txt @@ -0,0 +1 @@ +Vim plugins I use go here. diff --git a/public/.config/nvim/pack/mitsuo/start/fun/Readme.txt b/public/.config/nvim/pack/mitsuo/start/fun/Readme.txt new file mode 100644 index 0000000..2f41d59 --- /dev/null +++ b/public/.config/nvim/pack/mitsuo/start/fun/Readme.txt @@ -0,0 +1 @@ +My special functions :) diff --git a/public/.config/nvim/pack/mitsuo/start/fun/plugin/fun.vim b/public/.config/nvim/pack/mitsuo/start/fun/plugin/fun.vim new file mode 100644 index 0000000..c992f93 --- /dev/null +++ b/public/.config/nvim/pack/mitsuo/start/fun/plugin/fun.vim @@ -0,0 +1,121 @@ +" To call functions use `:call foo()` + +" Echoes longest line number and lenght. +function! LongestLineLength ( ) + let maxlength = 0 + let linenumber= 1 + while linenumber <= line("$") + exe ":".linenumber + let linelength = virtcol("$") + if maxlength < linelength + let maxlength = linelength + let maxlinenumber = linenumber + endif + let linenumber = linenumber+1 + endwhile + +"exe ':0' +"exe 'normal O' +"exe 'normal 0C'.maxlength + exe "normal" . maxlinenumber . "G" + exe ":echo \"" . maxlinenumber . ": " . maxlength . "\"" +endfunction + +command LongestLineLength call LongestLineLength() + + +" Save markdown document and export to pdf using pandoc. +" +" It would be nicer if a default document would be used but I coulnd't made it +" to work even after reading that manual section like 2 times. Also, there are +" variables that are lists of other variables that I don't know how to make them +" work (e.g. geometry=[top=1in, bottom=1in, heightrounded]) +function! Md2Pdf ( ) + exe ":w" + "-N for numbered headers + exe ":! pandoc -o \"" . expand("%:r") . ".pdf\" -t latex --variable classoption=twosides --variable papersize=a4 --variable margin-left=1in --variable margin-right=1in --variable margin-top=1in --variable margin-bottom=1in --variable links-as-notes --variable colorlinks --variable pagestyle=plain --variable documentclass=article -f markdown-implicit_figures \"" . expand("%") . "\"" + echo "pdf saved as \"" . expand("%:p:r") . ".pdf\"" +endfunction + +function! Md2Pdfms ( ) + exe ":w" + exe ":! pandoc -o " . expand("%:r") . ".pdf" . " -t ms -f markdown-implicit_figures \"" . expand("%") . "\"" + echo "pdf saved as " . expand("%:p:r") . ".pdf" +endfunction + +command Md2Pdf call Md2Pdf() +command Md2Pdfms call Md2Pdfms() + + +" Save markdown document and export to html using pandoc +function! Md2Html ( ) + exe ":w" + "exe ":! pandoc -s --toc -H ~/mahcode/markdown/pandoc/pandoc_style.html --highlight-style tango -o \"" . expand("%:r") . ".html\"" . " \"" . expand("%") . "\"" + exe ":! pandoc --highlight-style tango -o \"" . expand("%:r") . ".html\"" . " \"" . expand("%") . "\"" + echo "html saved as " . expand("%:p:r") . ".html" +endfunction + +command Md2Html call Md2Html() + +" Save markdown as ODT file (.docx is also possible) +function! Md2Odt ( ) + exe ":w" + exe ":! pandoc -s --toc -H ~/mahcode/markdown/pandoc/pandoc_style.html --highlight-style tango -o \"" . expand("%:r") . ".odt\"" . " \"" . expand("%") . "\"" + echo "ODT saved as " . expand("%:p:r") . ".odt" +endfunction + +command Md2Odt call Md2Odt() + + +" Compiles and Runs a C++ project +" TODO: how to add program's arguments or file redirectioning from command. +function! CompRunProj ( ) + exe ":w" + exe ":! g++ -o " . expand("%:r") . "-g *.cpp" + exe ":! ./" . expand("%:r") +endfunction + +command CompRunProj call CompRunProj() + + +" Function made to give feedback to students code in 1INF01 +" export C code to syntax highlighted pdf +function! C2Pdf ( ) + exe ":set ts=4" + exe ":w" + exe ":ha > %.ps" + exe ":!ps2pdf %.ps" + exe ":!rm %.ps" +endfunction + + +" For printing first export to html and then print using web browser +" Ref.: https://vi.stackexchange.com/questions/12058/printing-unicode-chars +function! ExportHTML (colorscheme="quiet", bg="light") + " Nice colorschemes for printing on paper: quiet, morning, mac_classic + let s:prev_color = g:colors_name + let s:prev_bg = &background + exe "colorscheme" a:colorscheme + exe "set bg=" . a:bg + + exe "TOhtml | w | !xdg-open %" + echo "html export saved as " . expand('%:p') + exe "bd" + + exe "colorscheme" s:prev_color + exe "set bg=" . s:prev_bg +endfunction + +command ExportHTML call ExportHTML() + +" C++ +" Formatting +" Ref.: https://clang.llvm.org/docs/ClangFormat.html +map :pyf /usr/share/clang/clang-format.py +"imap :py3f /usr/share/clang/clang-format.py + +"function! Formatonsave() +" let l:formatdiff = 1 +" pyf /usr/share/clang/clang-format.py +"endfunction +"autocmd BufWritePre *.h,*.hpp,*.cc,*.cpp call Formatonsave() diff --git a/public/.config/nvim/pack/mitsuo/start/vim-commentary b/public/.config/nvim/pack/mitsuo/start/vim-commentary new file mode 160000 index 0000000..e87cd90 --- /dev/null +++ b/public/.config/nvim/pack/mitsuo/start/vim-commentary @@ -0,0 +1 @@ +Subproject commit e87cd90dc09c2a203e13af9704bd0ef79303d755 diff --git a/public/.config/pandoc/linuxcolors_style.html b/public/.config/pandoc/linuxcolors_style.html new file mode 100644 index 0000000..e050698 --- /dev/null +++ b/public/.config/pandoc/linuxcolors_style.html @@ -0,0 +1,188 @@ + diff --git a/public/.config/ssh/Readme.txt b/public/.config/ssh/Readme.txt new file mode 100644 index 0000000..c902d49 --- /dev/null +++ b/public/.config/ssh/Readme.txt @@ -0,0 +1,8 @@ +important considerations for ssh: +- Change port to other than default (specially if exposed) +- Rate limit SSH traffic with a firewall (e.g., ufw) +- Disable password authentication (use RSA) +- Disable root login + +sshd_config goes to /etc/sshd_config in ArchLinux +config goes to ~/.ssh/config diff --git a/public/.config/ssh/config b/public/.config/ssh/config new file mode 100644 index 0000000..7979b64 --- /dev/null +++ b/public/.config/ssh/config @@ -0,0 +1,9 @@ +# global options +#User admin + +# host-specific options +Host example.com + Hostname 123.123.123.123 + #Port 22 + User pocoyo + #IdentityFile ~/path/to/key diff --git a/public/.config/ssh/sshd_config b/public/.config/ssh/sshd_config new file mode 100644 index 0000000..1e8358e --- /dev/null +++ b/public/.config/ssh/sshd_config @@ -0,0 +1,117 @@ +# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $ + +# This is the sshd server system-wide configuration file. See +# sshd_config(5) for more information. + +# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/bin + +# The strategy used for options in the default sshd_config shipped with +# OpenSSH is to specify options with their default value where +# possible, but leave them commented. Uncommented options override the +# default value. + +Port 22 # set a custom port +#AddressFamily any +#ListenAddress 0.0.0.0 +#ListenAddress :: + +#HostKey /etc/ssh/ssh_host_rsa_key +#HostKey /etc/ssh/ssh_host_ecdsa_key +#HostKey /etc/ssh/ssh_host_ed25519_key + +# Ciphers and keying +#RekeyLimit default none + +# Logging +#SyslogFacility AUTH +#LogLevel INFO + +# Authentication: + +#LoginGraceTime 2m +#PermitRootLogin prohibit-password +PermitRootLogin no +#StrictModes yes +#MaxAuthTries 6 +#MaxSessions 10 + +#PubkeyAuthentication yes + +# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 +# but this is overridden so installations will only check .ssh/authorized_keys +AuthorizedKeysFile .ssh/authorized_keys + +#AuthorizedPrincipalsFile none + +#AuthorizedKeysCommand none +#AuthorizedKeysCommandUser nobody + +# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts +#HostbasedAuthentication no +# Change to yes if you don't trust ~/.ssh/known_hosts for +# HostbasedAuthentication +#IgnoreUserKnownHosts no +# Don't read the user's ~/.rhosts and ~/.shosts files +#IgnoreRhosts yes + +# To disable tunneled clear text passwords, change to no here! +PasswordAuthentication no +#PermitEmptyPasswords no + +# Change to no to disable s/key passwords +KbdInteractiveAuthentication no + +# Kerberos options +#KerberosAuthentication no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes +#KerberosGetAFSToken no + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the KbdInteractiveAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via KbdInteractiveAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and KbdInteractiveAuthentication to 'no'. +UsePAM yes + +#AllowAgentForwarding yes +#AllowTcpForwarding yes +#GatewayPorts no +#X11Forwarding no +#X11DisplayOffset 10 +#X11UseLocalhost yes +#PermitTTY yes +PrintMotd no # pam does that +#PrintLastLog yes +#TCPKeepAlive yes +#PermitUserEnvironment no +#Compression delayed +#ClientAliveInterval 0 +#ClientAliveCountMax 3 +#UseDNS no +#PidFile /run/sshd.pid +#MaxStartups 10:30:100 +#PermitTunnel no +#ChrootDirectory none +#VersionAddendum none + +# no default banner path +#Banner none + +# override default of no subsystems +Subsystem sftp /usr/lib/ssh/sftp-server + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server diff --git a/public/.config/tmux/tmux.conf b/public/.config/tmux/tmux.conf new file mode 100644 index 0000000..e5a3e66 --- /dev/null +++ b/public/.config/tmux/tmux.conf @@ -0,0 +1,66 @@ +# Minimal tmux config +# Ref.: https://thevaluable.dev/tmux-config-mouseless/ + +# remap prefix from 'C-b' to 'C-a' +set-option -g prefix C-a +bind-key C-a send-prefix +unbind C-b + +# Start window numbering at 1 +set -g base-index 1 +setw -g pane-base-index 1 + +# Navigate history with vi keybindings +set-window-option -g mode-keys vi +set -g history-limit 10000 + +# From NeoVim advice: +# Fix 'escape-time' from 500ms to 10ms (better experience in Vim) +set-option -sg escape-time 10 +# focus-events (idk what this does) +set-option -g focus-events on + +# Vim friendly tmux config +# Ref.: https://gist.github.com/Lartza/6a7a62466a8a3e436234412d9b1c5066 + +setw -g monitor-activity on +set -g visual-activity on + +# FIXME: https://unix.stackexchange.com/a/131187/347754 +# y and p as in vim +bind Escape copy-mode +unbind p +bind p paste-buffer +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection +#bind-key -T copy-mode-vi 'Space' send -X halfpage-down +#bind-key -T copy-mode-vi 'Bspace' send -X halfpage-up + +# extra commands for interacting with the ICCCM clipboard +#bind C-c run "tmux save-buffer - | xclip -i -sel clipboard" +#bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" + +# easy-to-remember split pane commands +#bind | split-window -h +#bind - split-window -v +#unbind '"' +#unbind % +# Thanks: https://unix.stackexchange.com/a/109255/347754 +bind % split-window -h -c "#{pane_current_path}" +bind '"' split-window -v -c "#{pane_current_path}" + +# moving between panes with vim movement keys +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# moving between windows with vim movement keys +bind -r C-h select-window -t :- +bind -r C-l select-window -t :+ + +# resize panes with vim movement keys +bind -r H resize-pane -L 5 +bind -r J resize-pane -D 5 +bind -r K resize-pane -U 5 +bind -r L resize-pane -R 5 diff --git a/public/.config/vscode/Readme.adoc b/public/.config/vscode/Readme.adoc new file mode 100644 index 0000000..d14dc6f --- /dev/null +++ b/public/.config/vscode/Readme.adoc @@ -0,0 +1,7 @@ +Preferably use "Code - OSS" instead of VSCode. + +Changes: + +* Light solarized color scheme +* "Old" Activity Bar and Status Bar colors +* Rulers diff --git a/public/.config/vscode/keybindings.json b/public/.config/vscode/keybindings.json new file mode 100644 index 0000000..7c5b25b --- /dev/null +++ b/public/.config/vscode/keybindings.json @@ -0,0 +1,58 @@ +// Place your key bindings in this file to override the defaultsauto[] +[ + { + "key": "f8", + "command": "-editor.action.marker.nextInFiles", + "when": "editorFocus" + }, + { + "key": "f8", + "command": "workbench.action.debug.stepOver", + "when": "debugState == 'stopped'" + }, + { + "key": "f10", + "command": "-workbench.action.debug.stepOver", + "when": "debugState == 'stopped'" + }, + { + "key": "f7", + "command": "-editor.action.diffReview.next", + "when": "isInDiffEditor" + }, + { + "key": "f7", + "command": "-editor.action.wordHighlight.next", + "when": "editorTextFocus && hasWordHighlights" + }, + { + "key": "f7", + "command": "workbench.action.debug.stepInto", + "when": "debugState != 'inactive'" + }, + { + "key": "f11", + "command": "-workbench.action.debug.stepInto", + "when": "debugState != 'inactive'" + }, + { + "key": "shift+f7", + "command": "-editor.action.diffReview.prev", + "when": "isInDiffEditor" + }, + { + "key": "shift+f7", + "command": "-editor.action.wordHighlight.prev", + "when": "editorTextFocus && hasWordHighlights" + }, + { + "key": "shift+f7", + "command": "workbench.action.debug.stepOut", + "when": "debugState == 'stopped'" + }, + { + "key": "shift+f11", + "command": "-workbench.action.debug.stepOut", + "when": "debugState == 'stopped'" + } +] \ No newline at end of file diff --git a/public/.config/vscode/settings.json b/public/.config/vscode/settings.json new file mode 100644 index 0000000..1c0204d --- /dev/null +++ b/public/.config/vscode/settings.json @@ -0,0 +1,14 @@ +{ + "editor.minimap.enabled": false, + "editor.rulers": [80, 120], + "editor.wordWrap": "on", + "editor.lineNumbers": "off", + + "jupyter.askForKernelRestart": false, + "[python]": { + "editor.formatOnType": true + }, + "terminal.integrated.enableMultiLinePasteWarning": false, + "gitlens.hovers.currentLine.over": "line", + "autoDocstring.docstringFormat": "sphinx-notypes", +} diff --git a/public/.config/zathura/zathurarc b/public/.config/zathura/zathurarc new file mode 100644 index 0000000..4d38c70 --- /dev/null +++ b/public/.config/zathura/zathurarc @@ -0,0 +1,59 @@ +######################### +# Configuracion Zathura # +######################### +# +# para para saber que hace cada huevada +# ver manpage zathurarc(5) +# + +# Default commented shit +# ====================== + +# zoom and scroll step size +# set zoom-setp 20 +# set scroll-setp 80 + +# copy selection to system clipboard +# set selection-clipboard clipboard + +# enable incremental search +# set incremental-search true + +# mapings +# ======= + +# TODO Button 3 is left mouse button, I want to map it to 'hold to pan document' +# which is mapped to mouse 2 (middle button) +#map Button3 + +unmap [normal] +map [normal] toggle_statusbar +unmap [fullscreen] +map [fullscreen] toggle_statusbar + +unmap [normal] D +map [normal] D toggle_page_mode +unmap [fullscreen] D +map [fullscreen] D toggle_page_mode + +map [normal] u scroll half-up +map [normal] d scroll half-down +map [fullscreen] u scroll half-up +map [fullscreen] d scroll half-down + +# settings +# ======== + +#set window-width 768 +set window-width 1025 +set window-height 740 +set adjust-open width + +#set smooth-scroll true + +#set first-page-column 2 + +set statusbar-home-tilde true +#set window-title-home-tilde true +set window-title-basename true +set selection-clipboard clipboard -- cgit v1.2.3