diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-10-14 00:44:29 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-10-14 00:44:29 +0100 |
commit | bc3fae6b88308dc3e478954a0fb3d0b14809c2e8 (patch) | |
tree | 721374b530fae630fe5234f1f63e2dbe388763a8 /NeoVim | |
parent | e36e3bd66c5cb9b9d3a604017c75e356e2678abd (diff) | |
download | dotfiles-bc3fae6b88308dc3e478954a0fb3d0b14809c2e8.tar.gz dotfiles-bc3fae6b88308dc3e478954a0fb3d0b14809c2e8.tar.bz2 dotfiles-bc3fae6b88308dc3e478954a0fb3d0b14809c2e8.zip |
New neovim config
Uses lazy nvim and Lua instead of the old Vundle and vimscript setup.
Diffstat (limited to 'NeoVim')
-rw-r--r-- | NeoVim/.config/nvim/init.lua | 20 | ||||
-rw-r--r-- | NeoVim/.config/nvim/init.vim | 108 | ||||
-rw-r--r-- | NeoVim/.config/nvim/lazy-lock.json | 7 | ||||
-rw-r--r-- | NeoVim/.config/nvim/lua/config/lazy.lua | 22 | ||||
-rw-r--r-- | NeoVim/.config/nvim/lua/plugins/init.lua | 10 | ||||
-rw-r--r-- | NeoVim/.config/nvim/lua/plugins/neosolarized.lua | 11 | ||||
-rw-r--r-- | NeoVim/.config/nvim/lua/plugins/telescope.lua | 8 |
7 files changed, 78 insertions, 108 deletions
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 <Esc> - "" General keybind -nnoremap <leader>fp :e ~/.config/nvim/init.vim<CR> -nnoremap <leader>fei :e ~/.vim/ftplugin<CR> -nnoremap <leader>fr :so ~/.vimrc<CR>:PluginInstall<CR>:PluginClean<CR> -nnoremap <leader>qq :q!<CR> -nnoremap <leader>gs :G<CR> -nnoremap <leader><leader> : -nnoremap <leader>l :set relativenumber!<CR> - - "" File Management -nnoremap <leader>ff :Files <CR> -nnoremap <leader>fs :w<CR> -nnoremap <leader>fq :wq<CR> -nnoremap <leader>fn :enew<CR> -nnoremap <F8> :set hlsearch! hlsearch?<CR> - - "" Buffer Management -nnoremap <leader>bn :bn <CR> -nnoremap <leader>bp :bp <CR> -nnoremap <leader>bb :Buffers <CR> -nnoremap <leader>bd :bd <CR> - - "" Search -nnoremap <leader>ss :Lines<CR> - - "" Window Splits -nnoremap <leader>wv <C-W>v -nnoremap <leader>ws <C-W>s -nnoremap <leader>wd <C-W>q - - "" Window Movement -nnoremap <leader>wj <C-W><C-J> -nnoremap <leader>wk <C-W><C-K> -nnoremap <leader>wl <C-W><C-L> -nnoremap <leader>wh <C-W><C-H> - - "" Projects -nnoremap <leader>ot :NERDTreeToggle<CR> -nnoremap <leader>pg :!ctags-exuberant -R --exclude=Makefile . - - "" Tags -nnoremap <leader>tt :Tags<CR> 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", "<leader>ff", telescope.find_files, {}) + vim.keymap.set("n", "<leader>ss", telescope.current_buffer_fuzzy_find, {}) + end +} |