init
This commit is contained in:
		
							
								
								
									
										47
									
								
								.bashrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								.bashrc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
				
			|||||||
 | 
					#
 | 
				
			||||||
 | 
					# ~/.bashrc
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# If not running interactively, don't do anything
 | 
				
			||||||
 | 
					[[ $- != *i* ]] && return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# alias ls='ls --color=auto'
 | 
				
			||||||
 | 
					PS1='\[\e[0;38;5;24m\][\[\e[0;38;5;24m\]$(ip route get 1.1.1.1 2>/dev/null | awk -F"src " '"'"'NR==1{split($2,a," ");print a[1]}'"'"')\[\e[0;38;5;46m\]:\[\e[0;38;5;208m\]\W\[\e[0;38;5;24m\]]\[\e[0;38;5;24m\]\$ \[\e[0m\]'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					alias luamake=/home/oliver/sources/lua-language-server/3rd/luamake/luamake
 | 
				
			||||||
 | 
					alias l=lfcd
 | 
				
			||||||
 | 
					alias clip="xclip -selection clipboard"
 | 
				
			||||||
 | 
					alias phone="simple-mtpfs"
 | 
				
			||||||
 | 
					alias bell="paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
 | 
				
			||||||
 | 
					alias docker-ip="sudo docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}'"
 | 
				
			||||||
 | 
					alias useage="du -h -d 1 2> /dev/null | sort -h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export DENO_INSTALL="/home/oliver/.deno"
 | 
				
			||||||
 | 
					export PATH="$DENO_INSTALL/bin:$PATH"
 | 
				
			||||||
 | 
					export PATH="$HOME/.cargo/bin:$HOME/.local/bin/:$PATH"
 | 
				
			||||||
 | 
					export DOTNET_CLI_TELEMETRY_OPTOUT=1
 | 
				
			||||||
 | 
					export TORCH_CUDA_VERSION="cu117"
 | 
				
			||||||
 | 
					export LIBTORCH="/home/oliver/sources/libtorchcxx11"
 | 
				
			||||||
 | 
					export LD_LIBRARY_PATH="${LIBTORCH}/lib:$LD_LIBRARY_PATH"
 | 
				
			||||||
 | 
					export WINEPREFIX="$HOME/.wine/"
 | 
				
			||||||
 | 
					export DXVK_HUD="fps"
 | 
				
			||||||
 | 
					export EDITOR="nvim"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					lfcd () {
 | 
				
			||||||
 | 
					    tmp="$(mktemp)"
 | 
				
			||||||
 | 
					    lfrun -last-dir-path="$tmp" "$@"
 | 
				
			||||||
 | 
					    if [ -f "$tmp" ]; then
 | 
				
			||||||
 | 
					        dir="$(cat "$tmp")"
 | 
				
			||||||
 | 
					        rm -f "$tmp"
 | 
				
			||||||
 | 
					        if [ -d "$dir" ]; then
 | 
				
			||||||
 | 
					            if [ "$dir" != "$(pwd)" ]; then
 | 
				
			||||||
 | 
					                cd "$dir"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cpr() {
 | 
				
			||||||
 | 
					  rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@"
 | 
				
			||||||
 | 
					} 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										62
									
								
								.config/nvim/init.vim
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								.config/nvim/init.vim
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					" =============== Plugins ================================================
 | 
				
			||||||
 | 
					call plug#begin('~/.config/nvim/plugged')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Plug 'https://github.com/vim-airline/vim-airline' " status bset mouse=aar on the bottom
 | 
				
			||||||
 | 
					Plug 'https://github.com/preservim/nerdtree' " file tree
 | 
				
			||||||
 | 
					Plug 'https://github.com/airblade/vim-gitgutter' " git diff
 | 
				
			||||||
 | 
					" Plug 'https://github.com/weilbith/nvim-code-action-menu' " fix my shit helper window :)
 | 
				
			||||||
 | 
					Plug 'neoclide/coc.nvim', {'branch': 'release'} " code completion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					call plug#end()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" =============== Vannila vim config ================================================
 | 
				
			||||||
 | 
					:set clipboard=unnamedplus
 | 
				
			||||||
 | 
					:set relativenumber 
 | 
				
			||||||
 | 
					:windo set nowrap 
 | 
				
			||||||
 | 
					:set showcmd
 | 
				
			||||||
 | 
					:set mouse=a
 | 
				
			||||||
 | 
					" :set cursorline
 | 
				
			||||||
 | 
					:set foldmethod=syntax
 | 
				
			||||||
 | 
					:set updatetime=250
 | 
				
			||||||
 | 
					:set tabstop=4 shiftwidth=4 smarttab
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					" =============== NERDTree Config ================================================
 | 
				
			||||||
 | 
					:let NERDTreeShowHidden=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" =============== COC Config ================================================
 | 
				
			||||||
 | 
					inoremap <silent><expr> <TAB>
 | 
				
			||||||
 | 
					      \ coc#pum#visible() ? coc#pum#next(1) :
 | 
				
			||||||
 | 
					      \ CheckBackspace() ? "\<Tab>" :
 | 
				
			||||||
 | 
					      \ coc#refresh()
 | 
				
			||||||
 | 
					inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function! CheckBackspace() abort
 | 
				
			||||||
 | 
					  let col = col('.') - 1
 | 
				
			||||||
 | 
					  return !col || getline('.')[col - 1]  =~# '\s'
 | 
				
			||||||
 | 
					endfunction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Highlight the variable on hold
 | 
				
			||||||
 | 
					autocmd CursorHold * silent call CocActionAsync('highlight')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" coc rename
 | 
				
			||||||
 | 
					nnoremap <silent> rr <Plug>(coc-rename)
 | 
				
			||||||
 | 
					" Toggle file browser
 | 
				
			||||||
 | 
					nnoremap <C-e> :NERDTreeToggle<CR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Jump between references and definiton 
 | 
				
			||||||
 | 
					nnoremap <silent> <C-k> :call CocActionAsync('jumpReferences')<CR>
 | 
				
			||||||
 | 
					nnoremap <silent> K :call CocActionAsync('jumpDefinition')<CR>
 | 
				
			||||||
 | 
					" show help menu
 | 
				
			||||||
 | 
					nnoremap <C-u> :call CocActionAsync('codeAction', 'cursor')<CR>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					" Show Documentation
 | 
				
			||||||
 | 
					nnoremap <silent> J :call ShowDocumentation()<CR>
 | 
				
			||||||
 | 
					function! ShowDocumentation() " Show hover when provider exists, fallback to vim's builtin behavior.
 | 
				
			||||||
 | 
						if CocAction('hasProvider', 'hover')
 | 
				
			||||||
 | 
							call CocActionAsync('definitionHover')
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
							call feedkeys('K', 'in')
 | 
				
			||||||
 | 
						endif
 | 
				
			||||||
 | 
					endfunction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										42
									
								
								.xinitrc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								.xinitrc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					userresources=$HOME/.Xresources
 | 
				
			||||||
 | 
					usermodmap=$HOME/.Xmodmap
 | 
				
			||||||
 | 
					sysresources=/etc/X11/xinit/.Xresources
 | 
				
			||||||
 | 
					sysmodmap=/etc/X11/xinit/.Xmodmap
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# merge in defaults and keymaps
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -f $sysresources ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    xrdb -merge $sysresources
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -f $sysmodmap ]; then
 | 
				
			||||||
 | 
					    xmodmap $sysmodmap
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -f "$userresources" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    xrdb -merge "$userresources"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -f "$usermodmap" ]; then
 | 
				
			||||||
 | 
					    xmodmap "$usermodmap"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# start some nice programs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 | 
				
			||||||
 | 
					 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
 | 
				
			||||||
 | 
					  [ -x "$f" ] && . "$f"
 | 
				
			||||||
 | 
					 done
 | 
				
			||||||
 | 
					 unset f
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					xrandr --output HDMI-0 --mode 1920x1080 --rate 144 --brightness 0.8 --left-of DP-4
 | 
				
			||||||
 | 
					xrandr --output DP-4 --mode 1920x1080 --rate 165 --brightness 0.8 --primary
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					dbus-launch --exit-with-session awesome
 | 
				
			||||||
		Reference in New Issue
	
	Block a user