20 Commits

Author SHA1 Message Date
7bbf9b8c9b Update init.vim 2023-10-11 10:01:55 +02:00
f1ee5b1aff Restore old init.vim 2022-12-07 12:45:51 +01:00
db37bf1d54 u=update 2022-07-02 14:32:37 +02:00
f2ddfa9590 Adds path 2022-07-02 14:32:05 +02:00
e767ecead0 Arrows 2022-07-02 13:38:53 +02:00
9a6bc3197e Update bashrc 2022-07-02 13:37:27 +02:00
b982ecb5a5 Merge branch 'master' into dev 2022-05-17 16:25:42 +02:00
7f937a2902 Merge branch 'master' into dev 2022-05-08 19:21:05 +02:00
45210b6c8f Adds cdw alias 2022-04-19 11:25:37 +02:00
b35bc69b88 tw=120 2022-02-17 16:18:13 +01:00
ec14c1c073 Easy mount/umount luks encrypted partitions 2022-02-16 16:09:13 +01:00
611ab5791f Adds support for pass 2021-10-18 16:07:44 +02:00
2e567f0a65 Adds reporttime 2021-10-18 15:04:03 +02:00
409fb9bb4b Show online hours and minutes, refresh every 30 s 2021-10-18 14:55:35 +02:00
509ed9956f Adds time to prompt 2021-10-18 14:49:37 +02:00
ee50dfd355 Merge branch 'dev' of gitea.tforgione.fr:tforgione/dotfiles into dev 2021-10-11 14:10:59 +02:00
ef3986e99f Adds :Format 2021-10-11 14:10:52 +02:00
30396f438a Adds :Format 2021-10-11 14:07:45 +02:00
Nicolas Bertrand
b665d16bc5 Merge branch 'master' into dev 2021-07-02 15:38:56 +02:00
e2773fcf6c Migrate to coc 2021-06-26 22:16:10 +02:00
10 changed files with 244 additions and 190 deletions

8
bashrc
View File

@@ -62,7 +62,7 @@ if [ "$color_prompt" = yes ]; then
else else
color="\033[1;35m" color="\033[1;35m"
fi fi
PS1="${color}── \u\033[33m::\033[34m\w\033[0m\n${color}╰▶ \033[0m" PS1="${color}── \u\033[33m::\033[34m\w\033[0m\n${color}└▷ \033[0m"
else else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi fi
@@ -88,6 +88,12 @@ alias ll='ls -alF'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
export PATH=~/.config/dotfiles/bin/:$PATH
alias u=update
# Add an "alert" alias for long running commands. Use like so: # Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert # sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

0
bin/compress-pdf Normal file → Executable file
View File

19
bin/lmount Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
if [ "$#" -ne 2 ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects two arguments\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
exit 1
fi
if [ "$USER" != "root" ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lmount <drive> <mount point>"
exit 1
fi
# Mounts an encrypt external drive to a specified mount point
cryptsetup luksOpen $1 external
mount /dev/mapper/external $2

19
bin/lumount Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program expects one argument\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
exit 1
fi
if [ "$USER" != "root" ]; then
echo -e >&2 "\x1B[1;31merror:\x1B[0;1m this program must be run as root\x1B[0m"
echo -e >&2 "\x1B[1;33musage:\x1B[0;1m sudo lumount <mount point>"
exit 1
fi
# Mounts an encrypt external drive to a specified mount point
umount $1
cryptsetup luksClose external

15
coc-settings.json Normal file
View File

@@ -0,0 +1,15 @@
{
"languageserver": {
"rust": {
"command": "rustup",
"args": ["run", "nightly", "rust-analyzer"],
"filetypes": ["rust"],
"rootPatterns": ["Cargo.toml"]
},
"elm": {
"command": "elm-language-server",
"filetypes": ["elm"],
"rootPatterns": ["elm.json"]
}
}
}

View File

@@ -3,35 +3,22 @@ set nocompatible
" PLUGNIS ###########################################################{{{ " PLUGNIS ###########################################################{{{
call plug#begin() call plug#begin()
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
" General plugins " General plugins
Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline-themes'
Plug 'https://gitea.tforgione.fr/tforgione/peach.git' Plug 'https://gitea.tforgione.fr/tforgione/peach.git'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'w0rp/ale'
Plug 'tpope/vim-abolish' Plug 'tpope/vim-abolish'
" Language specific plugins " Language specific plugins
" C++
Plug 'Shougo/deoplete-clangx'
" Rust " Rust
Plug 'rust-lang/rust.vim' Plug 'rust-lang/rust.vim'
Plug 'racer-rust/vim-racer'
Plug 'sebastianmarkow/deoplete-rust'
" Elm " Elm
Plug 'ElmCast/elm-vim' Plug 'ElmCast/elm-vim'
Plug 'antew/vim-elm-language-server'
" Toml " Toml
Plug 'cespare/vim-toml' Plug 'cespare/vim-toml'
@@ -39,9 +26,6 @@ Plug 'cespare/vim-toml'
" Pug " Pug
Plug 'digitaltoad/vim-pug' Plug 'digitaltoad/vim-pug'
" Spandex
Plug 'rust-spandex/spandex.vim'
call plug#end() call plug#end()
" Line numbers and syntaxic coloration " Line numbers and syntaxic coloration
@@ -157,20 +141,11 @@ let g:markdown_composer_browser = 'firefox'
let g:instant_markdown_autostart = 0 let g:instant_markdown_autostart = 0
" }}} " }}}
" CODE COMPLETION ###################################################{{{ function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
" Use deoplete
let g:deoplete#enable_at_startup = 1
autocmd FileType elm call deoplete#custom#buffer_option('auto_complete', v:false)
" Autoclose preview
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
" Complete on tab
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" }}}
" CUSTOM THINGS DEPENDING ON ENV ####################################{{{ " CUSTOM THINGS DEPENDING ON ENV ####################################{{{
let g:rustfmt_autosave = 1 let g:rustfmt_autosave = 1

View File

@@ -51,11 +51,23 @@ alias bat="bat --paging=never"
alias rg="rg -uu" alias rg="rg -uu"
# Aliases for pass
alias p="pass"
alias pc="pass --clip"
# mkdir && cd # mkdir && cd
mkcd() { mkcd() {
mkdir $1 && cd $1 mkdir $1 && cd $1
} }
# which && cd
cdw() {
f=`which $1`
if [ $? -eq 0 ]; then
cd `dirname $f`
fi
}
# Initialize thefuck # Initialize thefuck
command -v thefuck > /dev/null 2>&1 command -v thefuck > /dev/null 2>&1

View File

@@ -20,7 +20,7 @@ DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/me # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/me
# Example format: plugins=(rails git textmate ruby lighthouse) # Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git myjump) plugins=(git myjump pass)
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh

View File

@@ -27,3 +27,4 @@ export WINEDEBUG=-all
export RUST_BACKTRACE=full export RUST_BACKTRACE=full
export TERM=xterm-256color export TERM=xterm-256color
export REPORTTIME=5

View File

@@ -83,11 +83,13 @@ local PR_TEMP=""
command -v vcgencmd > /dev/null && PR_TEMP=' ${PR_GREEN}$(vcgencmd measure_temp | cut -d = -f 2)${PR_NO_COLOR}' command -v vcgencmd > /dev/null && PR_TEMP=' ${PR_GREEN}$(vcgencmd measure_temp | cut -d = -f 2)${PR_NO_COLOR}'
local PR_DATE='${PR_BOLD}${PR_MAGENTA}[%D{%H:%M}]${PR_NO_COLOR}'
#PROMPT="${user_host} ${current_dir} ${rvm_ruby}${git_branch}$PR_PROMPT " #PROMPT="${user_host} ${current_dir} ${rvm_ruby}${git_branch}$PR_PROMPT "
separator='${PR_YELLOW}::${PR_NO_COLOR}' separator='${PR_YELLOW}::${PR_NO_COLOR}'
tty | read tty_value tty | read tty_value
if [[ $tty_value == *pts* ]]; then # if in a tty if [[ $tty_value == *pts* ]]; then # if in a tty
PROMPT="$PR_ARROW_UP${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP} PROMPT="$PR_ARROW_UP${PR_DATE} ${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP}
$PR_ARROW_DOWN$PR_PROMPT ${PR_NO_COLOR}" $PR_ARROW_DOWN$PR_PROMPT ${PR_NO_COLOR}"
return_code="%(?.%{$PR_GREEN%}%? ↵%{$PR_NO_COLOR%}.%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" return_code="%(?.%{$PR_GREEN%}%? ↵%{$PR_NO_COLOR%}.%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
else else
@@ -98,3 +100,8 @@ fi
RPS1=" ${return_code}" RPS1=" ${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$PR_NO_COLOR%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$PR_NO_COLOR%}"
TMOUT=30
TRAPALRM() {
zle reset-prompt
}