diff --git a/.config/nvim b/.config/nvim index 54fe9c5..2ef1c2f 160000 --- a/.config/nvim +++ b/.config/nvim @@ -1 +1 @@ -Subproject commit 54fe9c5a793a2fe57cb99f4c466fe92aa5208c9e +Subproject commit 2ef1c2fa607d90b6d42ae75b0f028bf81a223352 diff --git a/.gitignore b/.gitignore index a32dde6..ea7b66e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ # except: !.zshrc +!.vimrc +!.ideavimrc !.config !.config/nvim !.config/nvim/** diff --git a/.ideavimrc b/.ideavimrc new file mode 100644 index 0000000..82baed7 --- /dev/null +++ b/.ideavimrc @@ -0,0 +1,26 @@ +"" Source your .vimrc +source /home/plex/.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 + +" Do the joining with the ide +set ideajoin + +"" -- 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 diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..107e589 --- /dev/null +++ b/.vimrc @@ -0,0 +1,129 @@ +" GENERAL CONFIGS ---------------------------------------------------------------------------------- +syntax on " syntax highlighting +set nocompatible " disable compatibility to old-time vi +set number +set nocompatible +set hlsearch " highlight search +set incsearch " incremental search +set tabstop=4 " number of columns occupied by a tab +set softtabstop=4 " see multiple spaces as tab stops so does the right thing +set expandtab " converts tabs to white space +set shiftwidth=4 " width for auto indents +set autoindent " indent a new line the same amount as the line just typed +set number " add line numbers +set wildmode=longest,list " get bash-like tab completions +set cc=100 " set an 100 column border for good coding style +set mouse=a " enable mouse for help file editing and hitting prompts +set cursorline " highlight current cursor line +set ttyfast " Speed up scrolling in Vim +set fdm=indent " folding method syntax +set foldlevel=10 " only fold when a certain complexity is reached by default. + " This applies only at startup. +set numberwidth=4 " How much space the line numbers should take +set signcolumn=yes " Show extra icons in the line numbers (like git marks, errors) +set timeout timeoutlen=400 " How long to wait for non prefix free hotkey melodies +set ttimeoutlen=0 + +" Avoid showing message extra message when using completion +set shortmess+=c + +"allow auto-indenting depending on file type +filetype plugin indent on +filetype plugin on + + +let g:indentLine_char = '│' + +" HOTKEYS ------------------------------------------------------------------------------------------ +" add lines with double o +noremap oo o +noremap OO O + +" H and L for end and beginning +nmap H ^ +nmap L $ +vmap H ^ +vmap L $ + +" useful functions for arrow keys +" (and force the user to use `hjkl`) + +" right/left to add/remove a tab in the beginning of the line. +nmap << +nmap >> +" same for visual mode (plus reselecting stuff for visual mode) +vmap >gv + +" up and down move lines up and down +nmap :m -2 +nmap :m +1 +" same for visual mode (plus reselecting stuff for visual mode) +vmap :m -2 +vmap :m +1 + +" resize windows +nnoremap :vertical resize -1 +nnoremap :vertical resize +1 +nnoremap :resize -1 +nnoremap :resize +1 + +" hit F3 to toggle search highlighting" +nnoremap :set hlsearch! + +nnoremap +let mapleader=" " +map t :echo "leader tested!" +map h :noh + +" copy to Wayland clipboard when leader is used. (note, install gvim for this) +vnoremap wy y :call system("wl-copy", @") +nnoremap wY Y :call system("wl-copy", @") +nnoremap wy y :call system("wl-copy", @") +nnoremap wyy yy :call system("wl-copy", @") + +" copy to system clipboard when leader is used. (note, install gvim for this) +vnoremap y "+y +nnoremap Y "+Y +nnoremap y "+y +nnoremap yy "+yy + +" don't write the pasted upon stuff in visual mode into the register +vnoremap p pgvy + +" open terminal with F12 +nnoremap :terminal + +" vsplit with , then " +map " :vsplit + +" split with , then %" +map % :split + +" join with j +nnoremap j :join +" join up with J +nnoremap J :move .-2 :join + +" split lines with s +nnoremap s i +" split lines up with S +nnoremap S i V:m -2 + +" move screen a line up/down with alt U/D +nmap kzz +nmap jzz + +" spell checking ----------------------------------------------------------------------------------- +set spell spelllang=en + +" set a location +set spellfile=~/.config/nvim/spell/en.utf-8.add + +" go to last or next misspelled word +nnoremap zn ]s +nnoremap zN [s + +" same as above but only with bad words (unrecognized) +nnoremap Zn ]S +nnoremap ZN [S diff --git a/.zshrc b/.zshrc index 2d37765..507bf0a 100644 --- a/.zshrc +++ b/.zshrc @@ -1,11 +1,18 @@ ### ENVVARS -PATH="/usr/bin:/usr/sbin:$HOME/.local/bin:$HOME/.cargo/bin:/usr/local/bin" +PATH="/usr/bin:/usr/sbin:$HOME/.local/bin:$HOME/.cargo/bin:/usr/local/bin:$HOME/.deno/bin" export PATH export EDITOR=nvim export editor=nvim export XDG_CONFIG_HOME=~/.config export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P' export ZSH=$HOME/.zsh +export CLIPBOARD_NOGUI=1 # wayland only allows GUI apps to use the clipboard. + # cb would have to open every 2 seconds and steal + # focus. This sucks, so I will have to disable GUI + # integration (yes that means ctrl+v) for now. + # + # see https://github.com/Slackadays/Clipboard/issues/171 + ### Aliases alias l="lsd -lah" @@ -20,6 +27,7 @@ alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"' alias gg=lazygit alias reload="source ~/.zshrc" alias gls=/bin/ls +alias gotemp="cd $(mktemp -d)" ### non standard aliases if [ -f ~/.zsh_aliases ]; then @@ -37,6 +45,10 @@ function cachekeys () { exec 2>/dev/null; function newpass() { LC_ALL=C tr -dc '[:alnum:]' < /dev/urandom | head -c${1:-$0} } +function condac() { + conda activate $@ + export HOST=$(hostname) +} # TODO: make neorg a function, take a workspace as arg ### ---- zsh options ------------------------------------- @@ -180,4 +192,3 @@ then else eval "$(zoxide init zsh)" fi -