Compare commits

..

1 Commits

8 changed files with 32 additions and 121 deletions

View File

@ -1,19 +0,0 @@
#!/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

View File

@ -1,19 +0,0 @@
#!/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

View File

@ -1,15 +0,0 @@
{
"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,24 +3,35 @@ set nocompatible
" PLUGNIS ###########################################################{{{
call plug#begin()
" Conquer of Completion
Plug 'neoclide/coc.nvim', {'branch': 'release'}
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
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'https://gitea.tforgione.fr/tforgione/peach.git'
Plug 'scrooloose/nerdtree'
Plug 'w0rp/ale'
Plug 'tpope/vim-abolish'
" Language specific plugins
" C++
Plug 'Shougo/deoplete-clangx'
" Rust
Plug 'rust-lang/rust.vim'
Plug 'racer-rust/vim-racer'
Plug 'sebastianmarkow/deoplete-rust'
" Elm
Plug 'ElmCast/elm-vim'
Plug 'antew/vim-elm-language-server'
" Toml
Plug 'cespare/vim-toml'
@ -45,7 +56,6 @@ set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set tw=120
" }}}
" UI CONFIG #########################################################{{{
@ -147,49 +157,11 @@ let g:markdown_composer_browser = 'firefox'
let g:instant_markdown_autostart = 0
" }}}
" COC CONFIG ########################################################{{{
" CODE COMPLETION ###################################################{{{
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> gp <Plug>(coc-diagnostic-prev)
nmap <silent> gn <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" 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
@ -197,7 +169,19 @@ autocmd InsertLeave * if pumvisible() == 0|pclose|endif
" Complete on tab
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" }}}
" CUSTOM THINGS DEPENDING ON ENV ####################################{{{
let g:rustfmt_autosave = 1
let g:ale_linters = {}
let g:ale_c_parse_compile_commands=1
let g:ale_elm_ls_use_global = 1
let g:ale_linters_ignore = { 'elm': ['make'] }
let g:ale_lint_on_text_changed = 0
if $NVIM_DISABLE_PYTHON_LINTER == '1'
let g:ale_linters.python = []
endif
if $NVIM_DISABLE_JAVA_LINTER == '1'
let g:ale_linters.java = []
endif

View File

@ -51,23 +51,11 @@ alias bat="bat --paging=never"
alias rg="rg -uu"
# Aliases for pass
alias p="pass"
alias pc="pass --clip"
# mkdir && cd
mkcd() {
mkdir $1 && cd $1
}
# which && cd
cdw() {
f=`which $1`
if [ $? -eq 0 ]; then
cd `dirname $f`
fi
}
# Initialize thefuck
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/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/me
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git myjump pass)
plugins=(git myjump)
source $ZSH/oh-my-zsh.sh

View File

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

View File

@ -83,13 +83,11 @@ local PR_TEMP=""
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 "
separator='${PR_YELLOW}::${PR_NO_COLOR}'
tty | read tty_value
if [[ $tty_value == *pts* ]]; then # if in a tty
PROMPT="$PR_ARROW_UP${PR_DATE} ${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP}
PROMPT="$PR_ARROW_UP${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP}
$PR_ARROW_DOWN$PR_PROMPT ${PR_NO_COLOR}"
return_code="%(?.%{$PR_GREEN%}%? ↵%{$PR_NO_COLOR%}.%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})"
else
@ -100,8 +98,3 @@ fi
RPS1=" ${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$PR_NO_COLOR%}"
TMOUT=30
TRAPALRM() {
zle reset-prompt
}