From ba2dfc89f2d4d9632e0663ff9e595bee4980b2d2 Mon Sep 17 00:00:00 2001 From: ShreyasSarve Date: Wed, 13 Dec 2023 18:21:33 +0530 Subject: [PATCH] Initial Baseline commit --- .gitignore | 1 + coc-settings.json | 3 +++ init.vim | 18 +++++++++++++ leader_mappings.vim | 5 ++++ mappings.vim | 49 +++++++++++++++++++++++++++++++++++ plugins.vim | 3 +++ plugins_config/coc_config.vim | 12 +++++++++ plugins_config/nerd_tree.vim | 4 +++ plugins_config/plugins.lua | 15 +++++++++++ plugins_list.vim | 25 ++++++++++++++++++ themes/airline.vim | 21 +++++++++++++++ theming.vim | 5 ++++ 12 files changed, 161 insertions(+) create mode 100644 .gitignore create mode 100644 coc-settings.json create mode 100644 init.vim create mode 100644 leader_mappings.vim create mode 100644 mappings.vim create mode 100644 plugins.vim create mode 100644 plugins_config/coc_config.vim create mode 100644 plugins_config/nerd_tree.vim create mode 100644 plugins_config/plugins.lua create mode 100644 plugins_list.vim create mode 100644 themes/airline.vim create mode 100644 theming.vim diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..060f79b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +plugged/ diff --git a/coc-settings.json b/coc-settings.json new file mode 100644 index 0000000..8d6e9fa --- /dev/null +++ b/coc-settings.json @@ -0,0 +1,3 @@ +{ + "clangd.path": "~/.config/coc/extensions/coc-clangd-data/install/15.0.6/clangd_15.0.6/bin/clangd" +} diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..a49178f --- /dev/null +++ b/init.vim @@ -0,0 +1,18 @@ +:set number +:set relativenumber +:set autoindent +:set tabstop=4 +:set shiftwidth=4 +:set smarttab +:set softtabstop=4 +:set mouse=a +:set clipboard+=unnamedplus + +source $HOME/.config/nvim/plugins_list.vim +source $HOME/.config/nvim/plugins.vim +source $HOME/.config/nvim/theming.vim +source $HOME/.config/nvim/leader_mappings.vim +source $HOME/.config/nvim/mappings.vim +source $HOME/.config/nvim/themes/airline.vim + +command! -nargs=0 Prettier :CocCommand prettier.forceFormatDocument diff --git a/leader_mappings.vim b/leader_mappings.vim new file mode 100644 index 0000000..b63fd6f --- /dev/null +++ b/leader_mappings.vim @@ -0,0 +1,5 @@ +" Leader Key Mappings +let mapleader="," +nnoremap \ :vsplit + + diff --git a/mappings.vim b/mappings.vim new file mode 100644 index 0000000..6b62012 --- /dev/null +++ b/mappings.vim @@ -0,0 +1,49 @@ +" Key Mappings Nvim +nnoremap :NERDTreeFocus +nnoremap :bn +nnoremap :NERDTreeToggle +nnoremap :undo +nnoremap :redo + +" End of line +nnoremap +inoremap + +" Start of line +nnoremap +inoremap + +" Pasting directly from clipboard +nnoremap "+p + +" Moving line upwords +nnoremap :m .-2== +inoremap :m .-2 +nnoremap :m .-2== +inoremap :m .-2 + +" Moving line downwards +nnoremap :m .+1== +inoremap :m .+1 +nnoremap :m .+1== +inoremap :m .+1 + +" Refresh +nnoremap :source ~/.config/nvim/init.vim +inoremap :source ~/.config/nvim/init.vim + +" Duplicating Current line +nnoremap dd2PjA +inoremap dd2PjA + +" Selecting All +nnoremap ggVG +inoremap ggVG + +" Search Files +nnoremap :Telescope find_files +inoremap :Telescope find_files + +" Switchin betweeen opened Files +nnoremap :bn + diff --git a/plugins.vim b/plugins.vim new file mode 100644 index 0000000..62166d7 --- /dev/null +++ b/plugins.vim @@ -0,0 +1,3 @@ +source $HOME/.config/nvim/plugins_config/plugins.lua +source $HOME/.config/nvim/plugins_config/coc_config.vim +source $HOME/.config/nvim/plugins_config/nerd_tree.vim diff --git a/plugins_config/coc_config.vim b/plugins_config/coc_config.vim new file mode 100644 index 0000000..048f617 --- /dev/null +++ b/plugins_config/coc_config.vim @@ -0,0 +1,12 @@ +" use to trigger completion and navigate to the next complete item +function! CheckBackspace() abort + let col = col('.') - 2 + return !col || getline('.')[col - 2] =~# '\s' +endfunction + +inoremap + \ coc#pum#visible() ? coc#pum#next(2) : + \ CheckBackspace() ? "\" : + \ coc#refresh() + +inoremap coc#pum#visible() ? coc#pum#confirm() : "\" diff --git a/plugins_config/nerd_tree.vim b/plugins_config/nerd_tree.vim new file mode 100644 index 0000000..6b7676a --- /dev/null +++ b/plugins_config/nerd_tree.vim @@ -0,0 +1,4 @@ +" Nerd Tree Config +let g:NERDTreeDirArrowExpandable="↓" +let g:NERDTreeDirArrowCollapsible="↑" +let g:airline#extensions#tabline#enabled = 1 diff --git a/plugins_config/plugins.lua b/plugins_config/plugins.lua new file mode 100644 index 0000000..1773260 --- /dev/null +++ b/plugins_config/plugins.lua @@ -0,0 +1,15 @@ +require("mason").setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + }, + border = "none", + } +}) +require("mason-lspconfig").setup { + ensure_installed = { "lua_ls", "rust_analyzer" }, +} + +require("lspconfig").lua_ls.setup {} diff --git a/plugins_list.vim b/plugins_list.vim new file mode 100644 index 0000000..dde4126 --- /dev/null +++ b/plugins_list.vim @@ -0,0 +1,25 @@ +" List of All Plugins + +call plug#begin('~/.config/nvim/plugged') +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'https://github.com/vim-airline/vim-airline' +Plug 'http://github.com/tpope/vim-surround' " Surrounding ysw) +Plug 'https://github.com/preservim/nerdtree' " NerdTree +Plug 'https://github.com/tpope/vim-commentary' " For Commenting gcc & gc +Plug 'https://github.com/vim-airline/vim-airline' " Status bar +Plug 'https://github.com/rafi/awesome-vim-colorschemes' " Retro Scheme +Plug 'https://github.com/ryanoasis/vim-devicons' " Developer Icons +Plug 'https://github.com/terryma/vim-multiple-cursors' " CTRL + N for multiple cursors +Plug 'https://github.com/preservim/tagbar' " Tagbar for code navigation +Plug 'vim-airline/vim-airline-themes' +Plug 'dart-lang/dart-vim-plugin' +Plug 'akinsho/toggleterm.nvim', {'tag' : '*'} +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'daltonmenezes/aura-theme', { 'rtp': 'packages/neovim' } +Plug 'mhartington/formatter.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.5' } +Plug 'williamboman/mason.nvim' +Plug 'williamboman/mason-lspconfig.nvim' +Plug 'neovim/nvim-lspconfig' +call plug#end() diff --git a/themes/airline.vim b/themes/airline.vim new file mode 100644 index 0000000..687a50b --- /dev/null +++ b/themes/airline.vim @@ -0,0 +1,21 @@ +" enable tabline +let g:airline#extensions#tabline#enabled =1 +" let g:airline#extensions#tabline#left_sep='' +" let g:airline#extensions#tabline#left_alt_sep='' +" let g:airline#extensions#tabline#right_sep='' +" let g:airline#extensions#tabline#right_alt_sep='' + + +" enable powerline fonts +let g:airline_powerline_fonts = 1 +" let g:airline_left_sep = '' +" let g:airline_right_sep = '' + +" Switch theme +let g:airline_theme = 'onedark' + +" Always Show tabs +set showtabline=2 + +" for not showing insert/ visual / normal +set noshowmode diff --git a/theming.vim b/theming.vim new file mode 100644 index 0000000..8ab4af3 --- /dev/null +++ b/theming.vim @@ -0,0 +1,5 @@ +" Theming +set background=dark " or light if you want light mode +colorscheme aura-dark + +