From bc3fae6b88308dc3e478954a0fb3d0b14809c2e8 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 14 Oct 2024 00:44:29 +0100 Subject: New neovim config Uses lazy nvim and Lua instead of the old Vundle and vimscript setup. --- NeoVim/.config/nvim/init.lua | 20 +++++ NeoVim/.config/nvim/init.vim | 108 ----------------------- NeoVim/.config/nvim/lazy-lock.json | 7 ++ NeoVim/.config/nvim/lua/config/lazy.lua | 22 +++++ NeoVim/.config/nvim/lua/plugins/init.lua | 10 +++ NeoVim/.config/nvim/lua/plugins/neosolarized.lua | 11 +++ NeoVim/.config/nvim/lua/plugins/telescope.lua | 8 ++ 7 files changed, 78 insertions(+), 108 deletions(-) create mode 100644 NeoVim/.config/nvim/init.lua delete mode 100644 NeoVim/.config/nvim/init.vim create mode 100644 NeoVim/.config/nvim/lazy-lock.json create mode 100644 NeoVim/.config/nvim/lua/config/lazy.lua create mode 100644 NeoVim/.config/nvim/lua/plugins/init.lua create mode 100644 NeoVim/.config/nvim/lua/plugins/neosolarized.lua create mode 100644 NeoVim/.config/nvim/lua/plugins/telescope.lua (limited to 'NeoVim') diff --git a/NeoVim/.config/nvim/init.lua b/NeoVim/.config/nvim/init.lua new file mode 100644 index 0000000..598257a --- /dev/null +++ b/NeoVim/.config/nvim/init.lua @@ -0,0 +1,20 @@ +-- Bootstrap lazy.nvim +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" +vim.schedule(function() + vim.opt.clipboard = 'unnamedplus' +end) +vim.opt.termguicolors = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.wildmenu = true +vim.opt.expandtab = true +vim.opt.inccommand = 'split' +vim.opt.cursorline = true +vim.opt.scrolloff = 8 +vim.opt.autoindent = true +vim.cmd("set path+=**") + +-- Setup lazy.nvim +require("config.lazy") diff --git a/NeoVim/.config/nvim/init.vim b/NeoVim/.config/nvim/init.vim deleted file mode 100644 index 6a28892..0000000 --- a/NeoVim/.config/nvim/init.vim +++ /dev/null @@ -1,108 +0,0 @@ -set runtimepath^=~/.vim runtimepath+=~/.vim/after -let &packpath = &runtimepath -filetype off - -"" Plugins -set rtp+=~/.vim/bundle/Vundle.vim -set termguicolors - -call vundle#begin() - "" Core -Plugin 'gmarik/Vundle.vim' -Plugin 'tpope/vim-dispatch' -Plugin 'christoomey/vim-tmux-navigator' - - "" UI -Plugin 'scrooloose/nerdtree' - - "" Plugins -Plugin 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plugin 'junegunn/fzf.vim' -Plugin 'godlygeek/tabular' -Plugin 'tpope/vim-commentary' -Plugin 'tpope/vim-surround' -Plugin 'overcache/NeoSolarized' -Plugin 'altercation/vim-colors-solarized' -call vundle#end() - - -"" Standard variables -syntax enable -filetype plugin indent on -set nocompatible -set ignorecase -set smartcase -set clipboard=unnamed -set nobackup -set noundofile -set nowritebackup -set nohlsearch -set wildmenu -set tabstop=2 -set softtabstop=2 -set expandtab -set shiftwidth=2 -set previewheight=5 -set foldmethod=syntax -set foldlevel=99 -set path+=** -let mapleader = ' ' - - -"" Theming -set background=dark -colorscheme NeoSolarized -" Set backgrounds off => transparency! -highlight Normal guibg=none -highlight NonText guibg=none -highlight Normal ctermbg=none -highlight NonText ctermbg=none - -"" Dir Config -let g:NERDTreeHijackNetrw = 1 - - -"" Keybinds -imap jk - "" General keybind -nnoremap fp :e ~/.config/nvim/init.vim -nnoremap fei :e ~/.vim/ftplugin -nnoremap fr :so ~/.vimrc:PluginInstall:PluginClean -nnoremap qq :q! -nnoremap gs :G -nnoremap : -nnoremap l :set relativenumber! - - "" File Management -nnoremap ff :Files -nnoremap fs :w -nnoremap fq :wq -nnoremap fn :enew -nnoremap :set hlsearch! hlsearch? - - "" Buffer Management -nnoremap bn :bn -nnoremap bp :bp -nnoremap bb :Buffers -nnoremap bd :bd - - "" Search -nnoremap ss :Lines - - "" Window Splits -nnoremap wv v -nnoremap ws s -nnoremap wd q - - "" Window Movement -nnoremap wj -nnoremap wk -nnoremap wl -nnoremap wh - - "" Projects -nnoremap ot :NERDTreeToggle -nnoremap pg :!ctags-exuberant -R --exclude=Makefile . - - "" Tags -nnoremap tt :Tags diff --git a/NeoVim/.config/nvim/lazy-lock.json b/NeoVim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..266a614 --- /dev/null +++ b/NeoVim/.config/nvim/lazy-lock.json @@ -0,0 +1,7 @@ +{ + "NeoSolarized": { "branch": "master", "commit": "b94b1a9ad51e2de015266f10fdc6e142f97bd617" }, + "lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" }, + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } +} diff --git a/NeoVim/.config/nvim/lua/config/lazy.lua b/NeoVim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..7a9cd68 --- /dev/null +++ b/NeoVim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,22 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end + +vim.opt.rtp:prepend(lazypath) +require("lazy").setup({ + spec = { + { import = "plugins" } + }, + checker = { enabled = true } +}) diff --git a/NeoVim/.config/nvim/lua/plugins/init.lua b/NeoVim/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..9617fd8 --- /dev/null +++ b/NeoVim/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,10 @@ +local neosolarized = require ("plugins/neosolarized") +local telescope = require ("plugins/telescope") + +return { + neosolarized, + telescope, + { + "christoomey/vim-tmux-navigator", + } +} diff --git a/NeoVim/.config/nvim/lua/plugins/neosolarized.lua b/NeoVim/.config/nvim/lua/plugins/neosolarized.lua new file mode 100644 index 0000000..54a939f --- /dev/null +++ b/NeoVim/.config/nvim/lua/plugins/neosolarized.lua @@ -0,0 +1,11 @@ +return { + "overcache/NeoSolarized", + init = function () + vim.cmd.colorscheme "NeoSolarized" + -- Make background transparent + vim.cmd.hi "Normal guibg=none" + vim.cmd.hi "NonText guibg=none" + vim.cmd.hi "Normal ctermbg=none" + vim.cmd.hi "NonText ctermbg=none" + end +} diff --git a/NeoVim/.config/nvim/lua/plugins/telescope.lua b/NeoVim/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..5271a80 --- /dev/null +++ b/NeoVim/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,8 @@ +return { + "nvim-telescope/telescope.nvim", + config = function () + local telescope = require("telescope.builtin") + vim.keymap.set("n", "ff", telescope.find_files, {}) + vim.keymap.set("n", "ss", telescope.current_buffer_fuzzy_find, {}) + end +} -- cgit v1.2.3-13-gbd6f