made neovim config using XDG_BASE_FOLDER specifications

This commit is contained in:
Abhigyan Madhukalya
2022-10-08 18:43:06 +05:30
parent 8ff0e15eec
commit 8061281109
11 changed files with 391 additions and 308 deletions
+91
View File
@@ -0,0 +1,91 @@
-------------------------------------------------
-- DT'S NEOVIM CONFIGURATION
-- Neovim website: https://neovim.io/
-- DT's dotfiles: https://gitlab.com/dwt1/dotfiles
-------------------------------------------------
local g = vim.g
local o = vim.o
local opt = vim.opt
local A = vim.api
-- cmd('syntax on')
-- vim.api.nvim_command('filetype plugin indent on')
o.termguicolors = true
-- o.background = 'dark'
-- Do not save when switching buffers
-- o.hidden = true
-- Decrease update time
o.timeoutlen = 500
o.updatetime = 200
-- Number of screen lines to keep above and below the cursor
o.scrolloff = 8
-- Better editor UI
o.number = true
o.numberwidth = 2
o.relativenumber = true
o.signcolumn = "yes"
o.cursorline = true
-- Better editing experience
o.expandtab = true
o.smarttab = true
o.cindent = true
o.autoindent = true
o.wrap = true
o.textwidth = 300
o.tabstop = 4
o.shiftwidth = 4
o.softtabstop = -1 -- If negative, shiftwidth value is used
o.list = true
o.listchars = "trail:·,nbsp:◇,tab:→ ,extends:▸,precedes:◂"
-- o.listchars = 'eol:¬,space:·,lead: ,trail:·,nbsp:◇,tab:→-,extends:▸,precedes:◂,multispace:···⬝,leadmultispace:│ ,'
-- o.formatoptions = 'qrn1'
-- Makes neovim and host OS clipboard play nicely with each other
o.clipboard = "unnamedplus"
-- Case insensitive searching UNLESS /C or capital in search
o.ignorecase = true
o.smartcase = true
-- Undo and backup options
o.backup = false
o.writebackup = false
o.undofile = true
o.swapfile = false
-- o.backupdir = '/tmp/'
-- o.directory = '/tmp/'
-- o.undodir = '/tmp/'
-- Remember 50 items in commandline history
o.history = 50
-- Better buffer splitting
o.splitright = true
o.splitbelow = true
-- Preserve view while jumping
-- BUG This option causes an error!
-- o.jumpoptions = 'view'
-- BUG: this won't update the search count after pressing `n` or `N`
-- When running macros and regexes on a large file, lazy redraw tells neovim/vim not to draw the screen
-- o.lazyredraw = true
-- Better folds (don't fold by default)
-- o.foldmethod = 'indent'
-- o.foldlevelstart = 99
-- o.foldnestmax = 3
-- o.foldminlines = 1
--
opt.mouse = "a"
-- Map <leader> to space
g.mapleader = " "
g.maplocalleader = " "
+14
View File
@@ -0,0 +1,14 @@
-------------------------------------------------
-- DT'S NEOVIM CONFIGURATION
-- Neovim website: https://neovim.io/
-- DT's dotfiles: https://gitlab.com/dwt1/dotfiles
-------------------------------------------------
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap =
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
vim.cmd([[packadd packer.nvim]])
end
+28
View File
@@ -0,0 +1,28 @@
-------------------------------------------------
-- DT'S NEOVIM CONFIGURATION
-- Neovim website: https://neovim.io/
-- DT's dotfiles: https://gitlab.com/dwt1/dotfiles
-------------------------------------------------
-------------------------------------------------
-- COLORSCHEMES
-------------------------------------------------
-- Uncomment just ONE of the following colorschemes!
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-dracula')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-gruvbox-dark-medium')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-monokai')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-nord')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-oceanicnext')
local ok, _ = pcall(vim.cmd, "colorscheme base16-onedark")
-- local ok, _ = pcall(vim.cmd, 'colorscheme palenight')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-solarized-dark')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-solarized-light')
-- local ok, _ = pcall(vim.cmd, 'colorscheme base16-tomorrow-night')
-- Highlight the region on yank
A.nvim_create_autocmd("TextYankPost", {
group = num_au,
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 120 })
end,
})
+27
View File
@@ -0,0 +1,27 @@
-------------------------------------------------
-- DT'S NEOVIM CONFIGURATION
-- Neovim website: https://neovim.io/
-- DT's dotfiles: https://gitlab.com/dwt1/dotfiles
-------------------------------------------------
-------------------------------------------------
-- KEYBINDINGS
-------------------------------------------------
local function map(m, k, v)
vim.keymap.set(m, k, v, { silent = true })
end
-- Mimic shell movements
map("i", "<C-E>", "<ESC>A")
map("i", "<C-A>", "<ESC>I")
-- Load recent sessions
map("n", "<leader>sl", "<CMD>SessionLoad<CR>")
-- Keybindings for telescope
map("n", "<leader>fr", "<CMD>Telescope oldfiles<CR>")
map("n", "<leader>ff", "<CMD>Telescope find_files<CR>")
map("n", "<leader>fb", "<CMD>Telescope file_browser<CR>")
map("n", "<leader>fw", "<CMD>Telescope live_grep<CR>")
map("n", "<leader>ht", "<CMD>Telescope colorscheme<CR>")
+76
View File
@@ -0,0 +1,76 @@
-------------------------------------------------
-- DT'S NEOVIM CONFIGURATION
-- Neovim website: https://neovim.io/
-- DT's dotfiles: https://gitlab.com/dwt1/dotfiles
-------------------------------------------------
local status, packer = pcall(require, "packer")
if not status then
print("Packer is not installed")
return
end
-- Reloads Neovim after whenever you save plugins.lua
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerSync
augroup END
]])
packer.startup(function(use)
-- Packer can manage itself
use("wbthomason/packer.nvim")
-- Dashboard is a nice start screen for nvim
use("glepnir/dashboard-nvim")
-- Telescope
use({
"nvim-telescope/telescope.nvim",
tag = "0.1.0",
requires = { { "nvim-lua/plenary.nvim" } },
})
use("nvim-telescope/telescope-file-browser.nvim")
use("nvim-treesitter/nvim-treesitter") -- Treesitter Syntax Highlighting
-- Productivity
use("vimwiki/vimwiki")
use("jreybert/vimagit")
use("nvim-orgmode/orgmode")
use("folke/which-key.nvim") -- Which Key
use("nvim-lualine/lualine.nvim") -- A better statusline
-- File management --
use("vifm/vifm.vim")
use("scrooloose/nerdtree")
use("tiagofumo/vim-nerdtree-syntax-highlight")
use("ryanoasis/vim-devicons")
-- Tim Pope Plugins --
use("tpope/vim-surround")
-- Syntax Highlighting and Colors --
use("PotatoesMaster/i3-vim-syntax")
use("kovetskiy/sxhkd-vim")
use("vim-python/python-syntax")
use("ap/vim-css-color")
-- Junegunn Choi Plugins --
use("junegunn/goyo.vim")
use("junegunn/limelight.vim")
use("junegunn/vim-emoji")
-- Colorschemes --
use("RRethy/nvim-base16")
use("kyazdani42/nvim-palenight.lua")
-- Other stuff --
use("frazrepo/vim-rainbow")
if packer_bootstrap then
packer.sync()
end
end)