diff --git a/common/.config/Code/User/settings.json b/common/.config/Code/User/settings.json index 8e29190..e6edde3 100644 --- a/common/.config/Code/User/settings.json +++ b/common/.config/Code/User/settings.json @@ -8,8 +8,7 @@ "extensions.ignoreRecommendations": true, // Editor - "editor.fontSize": 21, // Increase the Editor's font to offset - "window.zoomLevel": -1, // Reduces the Activity Bar size + "editor.fontSize": 21, // Reduces the Activity Bar size "editor.cursorWidth": 4, "editor.minimap.enabled": false, "editor.wordWrap": "on", diff --git a/common/.config/nvim/spell/en.utf-8.add b/common/.config/nvim/spell/en.utf-8.add new file mode 100644 index 0000000..5ce9286 --- /dev/null +++ b/common/.config/nvim/spell/en.utf-8.add @@ -0,0 +1,3 @@ +#trl +Ctrl +youtube diff --git a/common/.config/nvim/spell/en.utf-8.add.spl b/common/.config/nvim/spell/en.utf-8.add.spl new file mode 100644 index 0000000..a027687 Binary files /dev/null and b/common/.config/nvim/spell/en.utf-8.add.spl differ diff --git a/common/.ideavimrc b/common/.ideavimrc index 1008917..499a81e 100644 --- a/common/.ideavimrc +++ b/common/.ideavimrc @@ -3,10 +3,14 @@ " Examples to map IDE actions to IdeaVim -- https://jb.gg/abva4t " Enable IdeaVim plugins https://jb.gg/ideavim-plugins -" Source .vimrc "source ~/.vimrc """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Set Tabs to 4 characters +set expandtab +set tabstop=4 +set shiftwidth=4 + " Searches set hlsearch " highlight search occurrences set ignorecase " ignore case in search patterns @@ -14,14 +18,32 @@ set smartcase " no ignore case when pattern is uppercase set incsearch " show search results while typing set wrapscan " searches wrap around the end of the file -" common settings +" Common settings +set number " Show current line number +set relativenumber " Show relative line numbers set gdefault " substitute all occurrences in line set history=10000 " command line history set scrolloff=5 sidescrolloff=10 " Keep some line before and after the cursor visible set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard +set nrfomats+=alpha,bin,octal,hex " Useful for auto incrementing """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -"keymaps +" Enabled plugins +set ideajoin +Plug 'easymotion/vim-easymotion' " j or J [2 characters] +Plug 'preservim/nerdtree' " e +Plug 'tpope/vim-surround' " ys or cs or ds [motion] +Plug 'tpope/vim-commentary' " gc [motion] +Plug 'machakann/vim-highlightedyank' +Plug 'dbakker/vim-paragraph-motion' +Plug 'chrisbra/matchit' +Plug 'tpope/vim-repeat' " Repeat for Surround +" Plug 'terryma/vim-multiple-cursors' " mc (selects), mx (skips), mp (previous) +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" To see a list of all available :actions -> :actionlist + " Or select "IdeaVim: Track Action Ids" -> Copy the action id required +" Keymaps let mapleader = " " " Don't use Ex mode, use Q for formatting @@ -36,24 +58,50 @@ map Q gq nnoremap zz nnoremap zz -" clear search highlighting +" Multiple Cursors +map mc +map mx +map mp + +" Clear search highlighting nnoremap / :nohls -" code navigations -nmap e :action GotoFile -nmap a :action FindInPath -nmap gr :action ShowUsages -nmap gi :action GotoImplementation -nmap gs :action GotoSuperMethod +" Find/Open file +nmap of :action GotoFile +nmap or :action RecentFiles + +" Find/Navigate to different parts of code +nmap gf :action FindInPath +nmap gr :action ShowUsages +nmap gi :action GotoImplementation +nmap gs :action GotoSuperMethod + +" Tabs nmap tn :action NextTab nmap tp :action PreviousTab +" NerdTree +nmap e :NERDTreeToggle + " When in the tree use the below default keybindings + " j, k - To go down and up + " p - Go to the parent directory + " P - Go the root directory + " s - open file in vertical split + " i - open in horizontal split + " t - open in a new tab + " o - Open the selected file or Expand the selected directory. + " - Also collapse the same directory. + " - Moves the cursor to the file. + " go - Opens the file but keeps the cursor on the file tree + " A - expand the file tree + " x - close the file tree + nmap :action ParameterInfo imap :action ParameterInfo nmap n :action GotoNextError map gh (ShowErrorDescription) -" code refactoring +" Code refactoring nmap ri :action Inline nmap rr :action RenameElement nmap rev :action IntroduceVariable @@ -66,21 +114,6 @@ nmap rG :action Generate nmap rf :action ReformatCode " Easy motion -map J (easymotion-s) -map j (easymotion-f) +map j (easymotion-s) nmap gr :action Vcs.RollbackChangedLines - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Enabled plugins -set ideajoin -Plug 'easymotion/vim-easymotion' -Plug 'preservim/NERDTree' -Plug 'tpope/surround' -Plug 'tpope/commentary' -Plug 'machakann/highlightedyank' -Plug 'dbakker/vim-paragraph-motion' -Plug 'chrisbra/matchit' -Plug 'tpope/vim-repeat' " Repeat for Surround -Plug 'airblade/vim-gitgutter' " Git gutter icons -Plug 'mg979/vim-visual-multi' " Multi Line Editing diff --git a/common/.vim/vimrc b/common/.vim/vimrc new file mode 100644 index 0000000..ff17984 --- /dev/null +++ b/common/.vim/vimrc @@ -0,0 +1,172 @@ +" Load the plugins +" This being the 1st line in the config file, +" makes it possible to configure plugins any place in the file. +call plug#begin('~/.vim/plugged') + Plug 'tpope/vim-fugitive' "Fugitive Vim GitHub Wrapper + Plug 'tpope/vim-surround' "Surround Plugin + Plug 'tpope/vim-repeat' "Repeat for the surround plugin + Plug 'tpope/vim-commentary' "Surround Plugin + Plug 'tpope/vim-sensible' "Sensible options + Plug 'rstacruz/vim-closer' "Auto-close brackets + Plug 'machakann/vim-highlightedyank' "Highlight Yank + Plug 'dbakker/vim-paragraph-motion' "Paragraph Motion + Plug 'airblade/vim-gitgutter' "Git in the left-side gutter + Plug 'junegunn/rainbow_parentheses.vim' "Rainbow parenthesis + Plug 'easymotion/vim-easymotion' "Easy Motion to quickly jump across the buffer + Plug 'preservim/nerdtree' "Nerd Tree + Plug 'kshenoy/vim-signature' "Show gutter icons for Vim marks + " Plug 'unblevable/quick-scope' "Quick Scope + " Plug 'bronson/vim-trailing-whitespace' "Highlight trailing spaces, remove them all with :FixWhitespace + "------------Style Plugins------------" + " Status Styles + Plug 'itchyny/lightline.vim' + Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' } "ColorScheme - Challenger-deep + Plug 'cocopon/iceberg.vim' "Color Scheme - Iceberg + Plug 'whatyouhide/vim-gotham' "Color Scheme - Gotham + Plug 'tyrannicaltoucan/vim-deep-space' "Color Scheme - Deep-space +call plug#end() + +" ------- Look and Feel ---------------- +" let g:lightline = { 'colorscheme': 'gotham'} +let g:lightline = { 'colorscheme': 'deepspace'} +colorscheme deep-space + +" Set color +if !has('gui_running') + set t_Co=256 + set termguicolors + hi LineNr ctermbg=NONE guibg=NONE +endif + +" ------- Making Vim an IDE ---------------- +" Better autocompletes +filetype plugin indent on +set omnifunc=syntaxcomplete#Complete +set complete+=kspell + +" Comments in Grey color and italic +hi Comment guifg=#5C6370 ctermfg=50 cterm=italic + +" Highlight and remove trailing blank spaces on save +highlight ExtraWhitespace ctermbg=red guibg=red +match ExtraWhitespace /\s\+$/ +autocmd BufWritePre * %s/\s\+$//e + +" Turn on syntax highlighting. +syntax on + +" Highlight matching pairs of [] {} () +set showmatch + +" Make sure tabs are 4 character wide +set shiftwidth=4 +set tabstop=4 +set softtabstop=4 +set expandtab +set autoindent +set smartindent + +" ------- Vim Related ---------------- +" Auto reload .vimrc +autocmd! bufwritepost ~/.vim/.vimrc source % + +" Show line numbers +set number + +" Relative line numbers +set relativenumber + +" Wrap text +set wrap + +" Status bar +" set laststatus=2 +" set noshowmode + +" Encoding +set encoding=utf-8 + +" Unbind some useless/annoying default key bindings. +nmap Q " 'Q' in normal mode enters Ex mode. You almost never want this. + +" Vim is based on Vi. Setting `nocompatible` switches from the default +" Vi-compatibility mode and enables useful Vim functionality. This +" configuration option turns out not to be necessary for the file named +" '~/.vimrc', because Vim automatically enters nocompatible mode if that file +" is present. But we're including it here just in case this config file is +" loaded some other way (e.g. saved as `foo`, and then Vim started with +" `vim -u foo`). +set nocompatible + +" Disable the default Vim startup message. +set shortmess+=I + +" Normally, backspace works only if you have made an edit. This fixes that. +set backspace=indent,eol,start + +" A line to specify 80 column limit +" setlocal colorcolumn=80 + +" Vim, by default, won't let you jump to a different file without saving the +" current one. With the below, unsaved files are just hidden. +set hidden + +" This setting makes search case-insensitive when all characters in the string +" being searched are lowercase. However, the search becomes case-sensitive if +" it contains any capital letters. This makes searching more convenient. +set ignorecase +set smartcase + +" Enable searching as you type, rather than waiting till you press enter. +set incsearch + +" Highlight search pattern +set hlsearch + +" Disable audible bell because it's annoying. +set noerrorbells visualbell t_vb= + +" Enable mouse support. You should avoid relying on this too much, but it can +" sometimes be convenient. +set mouse+=a + +" No header spam in netrw +let g:netrw_banner=0 + +" Display directory in tree style in netrw +let g:netrw_liststyle=3 + +" Sync vim clipboard with system clipboard +" Works across Linux, MacOS & Windows +set clipboard^=unnamed,unnamedplus + +" ------- Remap Keybindings ---------------- +" Disable left, right, up and down keys +" In normal mode... +nnoremap :echoe "Use h" +nnoremap :echoe "Use l" +nnoremap :echoe "Use k" +nnoremap :echoe "Use j" +" ...and in insert mode +inoremap :echoe "Use h" +inoremap :echoe "Use l" +inoremap :echoe "Use k" +inoremap :echoe "Use j" + +" Center the cursor when moving through file +nnoremap zz +nnoremap zz +nnoremap g; g;zz +nnoremap g, g,zz +nnoremap zz +nnoremap zz +nnoremap ]s ]szz + +" Make space-bar the leader-key +let mapleader = " " + +" Map easymotion Plugin to j +map j (easymotion-s) + +" Map nerdtree to e +map e :NERDTreeToggle diff --git a/common/.vimrc b/common/.vimrc deleted file mode 100644 index 6f7f60d..0000000 --- a/common/.vimrc +++ /dev/null @@ -1,116 +0,0 @@ -" Show line numbers -set number - -" This enables relative line numbering mode. With both number and -" relativenumber enabled, the current line shows the true line number, while -" all other lines (above and below) are numbered relative to the current line. -" This is useful because you can tell, at a glance, what count is needed to -" jump up or down to a particular line, by {count}k to go up or {count}j to go -" down. -set relativenumber - -" Wrap text -set wrap - -" Encoding -set encoding=utf-8 - -" Status bar -" set laststatus=2 -" set noshowmode - -" Set color -if !has('gui_running') - set t_Co=256 - set termguicolors - hi LineNr ctermbg=NONE guibg=NONE -endif - -" Comments in Grey color and italic -hi Comment guifg=#5C6370 ctermfg=50 cterm=italic - -" Vim is based on Vi. Setting `nocompatible` switches from the default -" Vi-compatibility mode and enables useful Vim functionality. This -" configuration option turns out not to be necessary for the file named -" '~/.vimrc', because Vim automatically enters nocompatible mode if that file -" is present. But we're including it here just in case this config file is -" loaded some other way (e.g. saved as `foo`, and then Vim started with -" `vim -u foo`). -set nocompatible - -" Turn on syntax highlighting. -syntax on - -" Highlight matching pairs of [] {} () -set showmatch - -" Disable the default Vim startup message. -set shortmess+=I - -" The backspace key has slightly unintuitive behavior by default. For example, -" by default, you can't backspace before the insertion point set with 'i'. -" This configuration makes backspace behave more reasonably, in that you can -" backspace over anything. -set backspace=indent,eol,start - -" By default, Vim doesn't let you hide a buffer (i.e. have a buffer that isn't -" shown in any window) that has unsaved changes. This is to prevent you from " -" forgetting about unsaved changes and then quitting e.g. via `:qa!`. We find -" hidden buffers helpful enough to disable this protection. See `:help hidden` -" for more information on this. -set hidden - -" This setting makes search case-insensitive when all characters in the string -" being searched are lowercase. However, the search becomes case-sensitive if -" it contains any capital letters. This makes searching more convenient. -set ignorecase -set smartcase - -" Enable searching as you type, rather than waiting till you press enter. -set incsearch - -" Highlight search pattern -set hlsearch - -" Unbind some useless/annoying default key bindings. -nmap Q " 'Q' in normal mode enters Ex mode. You almost never want this. - -" Disable audible bell because it's annoying. -set noerrorbells visualbell t_vb= - -" Enable mouse support. You should avoid relying on this too much, but it can -" sometimes be convenient. -set mouse+=a - -" Sync vim clipboard with system clipboard -" Works across Linux, MacOS & Windows -set clipboard^=unnamed,unnamedplus - -" Try to prevent bad habits like using the arrow keys for movement. This is -" not the only possible bad habit. For example, holding down the h/j/k/l keys -" for movement, rather than using more efficient movement commands, is also a -" bad habit. The former is enforceable through a .vimrc, while we don't know -" how to prevent the latter. -" Do this in normal mode... -nnoremap :echoe "Use h" -nnoremap :echoe "Use l" -nnoremap :echoe "Use k" -nnoremap :echoe "Use j" -" ...and in insert mode -inoremap :echoe "Use h" -inoremap :echoe "Use l" -inoremap :echoe "Use k" -inoremap :echoe "Use j" - -" Center the cursor when doing 1/2 page down and page up -nnoremap zz -nnoremap zz - -" Call the .vimrc.plug file -if filereadable(expand("~/.vimrc.plug")) - source ~/.vimrc.plug -endif - -" let g:lightline = { 'colorscheme': 'gotham'} -let g:lightline = { 'colorscheme': 'deepspace'} -colorscheme deep-space diff --git a/common/.vimrc.plug b/common/.vimrc.plug deleted file mode 100644 index 1a0f947..0000000 --- a/common/.vimrc.plug +++ /dev/null @@ -1,55 +0,0 @@ -call plug#begin('~/.vim/plugged') - -"Fugitive Vim Github Wrapper -Plug 'tpope/vim-fugitive' - -" Surround Plugin -Plug 'tpope/vim-surround' - -" Repeat for the surround plugin -Plug 'tpope/vim-repeat' - -" Surround Plugin -Plug 'tpope/vim-commentary' - -" Sensible options -Plug 'tpope/vim-sensible' - -" Auto-close brackets -Plug 'rstacruz/vim-closer' - -" Highlight Yank -Plug 'machakann/vim-highlightedyank' - -" Paragraph Motion -Plug 'dbakker/vim-paragraph-motion' - -" Quick Scope -" Plug 'unblevable/quick-scope' - -" Git in the left-side gutter -Plug 'airblade/vim-gitgutter' - -" Rainbow parenthesis -Plug 'junegunn/rainbow_parentheses.vim' - -" Highlight trailing spaces - remove them all with :FixWhitespace -Plug 'bronson/vim-trailing-whitespace' - -"------------Look and Feel------------" -" Status Styles -Plug 'itchyny/lightline.vim' - -" ColorScheme - Challenger-deep -Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' } - -" Color Scheme - Iceberg -Plug 'cocopon/iceberg.vim' - -" Color Scheme - Gotham -Plug 'whatyouhide/vim-gotham' - -" Color Scheme - Deep-space -Plug 'tyrannicaltoucan/vim-deep-space' - -call plug#end()