From 8a5241b605c639e3ddbebaab218a62545fa0d116 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Thu, 9 Nov 2023 16:15:30 +0300 Subject: [PATCH] Some changes - Change style of prompt in tcsh - Add alias for loading vim session to .tcshrc, add mappings for it to init.vim --- nvim/init.vim | 52 +++++++++++++++++++++++++++-------------------- tcsh/.precmd.tcsh | 2 +- tcsh/.tcshrc | 10 ++++++--- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 89fb9a9..8c4f928 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,3 +1,25 @@ +" Plugins +call plug#begin() + Plug 'catppuccin/nvim', { 'as': 'catppuccin' } + " Status & tab bars + Plug 'itchyny/lightline.vim' + " Automaticly create closing bracket + Plug 'windwp/nvim-autopairs' + " Plugin for comfortable navigating + Plug 'preservim/nerdtree' + " Plugin for surround text in something faster + Plug 'kylechui/nvim-surround' + " Plugin for snippets + Plug 'dcampos/nvim-snippy' + " Plugin for git integration + Plug 'tpope/vim-fugitive' +call plug#end() + +autocmd VimEnter * + \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) + \| PlugInstall --sync | q + \| endif + " Set variables set number set relativenumber @@ -30,28 +52,6 @@ let g:lightline = { \ }, \ } -" Plugins -call plug#begin() - Plug 'catppuccin/nvim', { 'as': 'catppuccin' } - " Status & tab bars - Plug 'itchyny/lightline.vim' - " Automaticly create closing bracket - Plug 'windwp/nvim-autopairs' - " Plugin for comfortable navigating - Plug 'preservim/nerdtree' - " Plugin for surround text in something faster - Plug 'kylechui/nvim-surround' - " Plugin for snippets - Plug 'dcampos/nvim-snippy' - " Plugin for git integration - Plug 'tpope/vim-fugitive' -call plug#end() - -autocmd VimEnter * - \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | q - \| endif - autocmd TermOpen * setlocal nonumber norelativenumber @@ -75,6 +75,9 @@ nmap :vertical resize +5 nmap n :nohlsearch " Saving time to not write ":Git " nmap g :Git +nmap q :enewbd # +nmap v :vsplit +nmap s :split " Terminal nnoremap t :terminali @@ -91,6 +94,11 @@ xmap (snippy-cut-text) nmap zj ok nmap zk Oj +" Sessions +nmap z :mksession! +nmap x :source Session.vim +nmap e :mksession! :wqa + " Setupping colorscheme catppuccin-frappe diff --git a/tcsh/.precmd.tcsh b/tcsh/.precmd.tcsh index 94e693d..6b12401 100644 --- a/tcsh/.precmd.tcsh +++ b/tcsh/.precmd.tcsh @@ -1,3 +1,3 @@ set __prompt_key_color="${__host_color}" if (! $__last_code == 0) set __prompt_key_color="%{\033[38;2;231;130;132m%}" -set prompt="${__host_color}%n@%m ${__git_color}`__git_current_branch`${__path_color}%~ ${__prompt_key_color}${__prompt_key}${__reset_color}${__reset_cursor} " +set prompt="${__host_color}%n@%m ${__git_color}`__git_current_branch`${__path_color}%C ${__prompt_key_color}${__prompt_key}${__reset_color}${__reset_cursor} " diff --git a/tcsh/.tcshrc b/tcsh/.tcshrc index a69c967..656a785 100644 --- a/tcsh/.tcshrc +++ b/tcsh/.tcshrc @@ -1,14 +1,17 @@ +set SHELL="`which tcsh`" if ($?prompt) then + set complete=enhance + set __prompt_key='$' if ($USER == "root") set __prompt_key='#' alias __git_current_branch 'git rev-parse --abbrev-ref HEAD >& /dev/null && echo "(`git rev-parse --abbrev-ref HEAD`) "' set __reset_cursor="%{\e[3 q%}" - set __host_color="%{\033[38;2;140;170;238m%}" - set __git_color="%{\033[38;2;131;139;167m%}" - set __path_color="%{\033[38;2;202;158;230m%}" set __reset_color="%{\033[0m%}" + set __host_color="${__reset_color}%{\033[38;2;140;170;238m%}" + set __git_color="${__reset_color}%{\033[38;2;131;139;167m%}" + set __path_color="${__reset_color}%{\033[1m%}%{\033[38;2;202;158;230m%}" alias precmd 'set __last_code=$?; source ~/.precmd.tcsh' endif @@ -25,3 +28,4 @@ alias stdn "doas shutdown -ah 0" alias rbot "doas reboot" alias dv "doas nvim" alias vi "nvim" +alias vis "nvim -S Session.vim"