summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bash_aliases3
-rw-r--r--bashrc5
-rw-r--r--install.sh12
-rw-r--r--vim/fun.vim13
-rw-r--r--vim/pack/mitsuo/README.md12
-rw-r--r--vim/viminfo31
-rw-r--r--vim/vimrc5
7 files changed, 73 insertions, 8 deletions
diff --git a/bash_aliases b/bash_aliases
index 89ea6e0..185c040 100644
--- a/bash_aliases
+++ b/bash_aliases
@@ -3,6 +3,7 @@
alias aliases='vim ~/.bash_aliases && source ~/.bash_aliases'
alias evrc='vim ~/.vim/vimrc'
alias ebrc='vim ~/.bashrc && source ~/.bashrc'
+alias jupyter-lab='jupyter-lab . &> /dev/null &' # Redirect stdout and stderr
# Common program's options
@@ -29,6 +30,8 @@ alias rm='rm -I' # Promt before removing more than 3 files
alias mv='mv -i' # Promt before overwrite
alias cp='cp -i' # same
+#alias sqlite3='sqlite3 --safe' # Disables some really cool dot-commands
+
# Other program's options
# ======================================================================
diff --git a/bashrc b/bashrc
index a546c35..bb389e0 100644
--- a/bashrc
+++ b/bashrc
@@ -141,8 +141,9 @@ if [ -f /usr/games/cowsay ]; then
# TODO: randomly select one of the following greeting commands
#cowsay -f flaming-sheep "oh no" # original
#cowsay $(fortune -e 30% debian-hints 20% linux 20% science \
- cowsay $(fortune 30% debian-hints 20% linux 20% science \
- 20% off/linux 10% off/black-humor)
+ #cowsay $(fortune 30% debian-hints 20% linux 20% science \
+ # 20% off/linux 10% off/black-humor)
+ cowsay $(fortune)
#fortune ascii-art
fi
diff --git a/install.sh b/install.sh
index c882578..6d794b3 100644
--- a/install.sh
+++ b/install.sh
@@ -21,10 +21,11 @@ mode="copy" # copy,slink
# Auto config
# ===========
+# Append ~ later (bash only does 1 substitution of variables)
if [[ $platform = "linux" ]]; then
- VIMFILES="~/.vim"
+ VIMFILES=".vim"
elif [[ $platform = "windows" ]]; then
- VIMFILES="~/vimfiles"
+ VIMFILES="vimfiles"
fi
[[ $mode = "copy" ]] && cp_or_ln="cp"
@@ -46,10 +47,11 @@ eval $cp_or_ln " ${PWD}/inputrc ~/.inputrc"
# ~/.vimrc takes priority over ~/.vim/vimrc, so remove the former first
-mkdir -p $VIMFILES/{undo,swap,backup,pack}
+[ -d ~/.vim/ ] || mkdir -p ~/$VIMFILES/{undo,swap,backup,plugins}
+chmod 0700 ~/.vim/swap # swap files should only be readable by owner
-eval $cp_or_ln " ${PWD}/vim/vimrc $VIMFILES/vimrc"
-eval $cp_or_ln " ${PWD}/vim/fun.vim $VIMFILES/fun.vim"
+eval $cp_or_ln " ${PWD}/vim/vimrc ~/$VIMFILES/vimrc"
+eval $cp_or_ln " ${PWD}/vim/fun.vim ~/$VIMFILES/fun.vim"
# done
diff --git a/vim/fun.vim b/vim/fun.vim
index 0dbfe11..25b71ca 100644
--- a/vim/fun.vim
+++ b/vim/fun.vim
@@ -51,12 +51,23 @@ command Md2Pdfms call Md2Pdfms()
function! Md2Html ( )
exe ":w"
- exe ":! pandoc -o \"" . expand("%:r") . ".html\"" . " -s \"" . expand("%") . "\""
+ exe ":! pandoc -s --toc -H ~/mahcode/markdown/pandoc/pandoc_style.html --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.
diff --git a/vim/pack/mitsuo/README.md b/vim/pack/mitsuo/README.md
new file mode 100644
index 0000000..172c269
--- /dev/null
+++ b/vim/pack/mitsuo/README.md
@@ -0,0 +1,12 @@
+Plugins I usually use and work fine together.
+
+- [NERDTree](https://github.com/preservim/nerdtree)
+
+ <C-t>
+
+- [vim-fugitive](https://github.com/tpope/vim-fugitive)
+
+ :G
+ :G blame
+
+Vim packages (version >= 8.2). See `:h packages`
diff --git a/vim/viminfo b/vim/viminfo
new file mode 100644
index 0000000..7651f85
--- /dev/null
+++ b/vim/viminfo
@@ -0,0 +1,31 @@
+# This viminfo file was generated by Vim 8.2.
+# You may edit it if you're careful!
+
+# Viminfo version
+|1,4
+
+# Value of 'encoding' when this file was written
+*encoding=utf-8
+
+
+# hlsearch on (H) or off (h):
+~h
+# Command Line History (newest to oldest):
+:q
+|2,0,1649356827,,"q"
+
+# Search String History (newest to oldest):
+
+# Expression History (newest to oldest):
+
+# Input Line History (newest to oldest):
+
+# Debug Line History (newest to oldest):
+
+# Registers:
+
+# File marks:
+
+# Jumplist (newest first):
+
+# History of marks within files (newest to oldest):
diff --git a/vim/vimrc b/vim/vimrc
index ccbfd0d..42fcc69 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -21,6 +21,8 @@ let $VIMFILES=split(&rtp,",")[0]
set undodir=$VIMFILES/undo
set viminfofile=$VIMFILES/viminfo
set viewdir=$VIMFILES/view
+set directory=$VIMFILES/swap
+set viminfofile=$VIMFILES/viminfo
" Useful
@@ -184,6 +186,9 @@ vmap gt :s/\<\(\w\)\(\w*\)\>/\u\1\L\2/g<CR><C-L>
" output.)
" :%!jq .
+" NERDTree plugin
+nnoremap <C-t> :NERDTreeToggle<CR>
+
" Yanking and pasting
" ----------------------------------------------------------------------