Call the new plugins
    Add gruvbox colorscheme
    Turn off jump on jumpable for code snippets
    Add git integration
    Remove unnecessary keybinds
    Change keybinds for LSP functions
    Turn off format on buffer write
    Add plugin sources
    Remove 'help' from syntax highlighting
    Add transparency option
    Add visible indentations

Changes to be committed:
    modified:   init.lua
    modified:   lua/colorschemes.lua
    modified:   lua/completions.lua
    new file:   lua/git-integration.lua
    modified:   lua/keybinds.lua
    modified:   lua/lsp-config.lua
    modified:   lua/lsp-format.lua
    modified:   lua/plugins.lua
    modified:   lua/syntax-highlight.lua
    new file:   lua/transparency.lua
    new file:   lua/visible-indents.lua
This commit is contained in:
Arkaprabha Chakraborty
2023-06-09 06:38:22 +05:30
parent 177157d404
commit f00e435d4e
11 changed files with 283 additions and 104 deletions

View File

@@ -11,3 +11,6 @@ require("fuzzy-finder")
require("syntax-highlight")
require("lsp-config")
require("lsp-format")
require("transparency")
require("visible-indents")
require("git-integration")

View File

@@ -1,31 +1,4 @@
local colorscheme = "base16-black-metal" -- Set colorscheme
if colorscheme == "base16-black-metal" then
local ok, base16 = pcall(require, "base16-colorscheme")
if not ok then
return
end
base16.setup({
--base00 = "#000000",
base00 = "#171717",
base01 = "#121212",
base02 = "#222222",
--base03 = "#333333",
base03 = "#494949",
base04 = "#999999",
base05 = "#c1c1c1",
base06 = "#999999",
base07 = "#c1c1c1",
base08 = "#5f8787",
base09 = "#aaaaaa",
base0A = "#a06666",
base0B = "#dd9999",
base0C = "#aaaaaa",
base0D = "#888888",
base0E = "#999999",
base0F = "#444444",
})
end
local colorscheme = "gruvbox" -- Set colorscheme { gruvbox, onedark, catppuccin, nord, dracula }
if colorscheme == "onedark" then
-- Onedark Default Configuration
@@ -138,7 +111,12 @@ if colorscheme == "gruvbox" then
undercurl = true,
underline = true,
bold = true,
italic = true,
italic = {
strings = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
@@ -165,3 +143,64 @@ if colorscheme == "nord" then
vim.cmd([[colorscheme nord]])
end
if colorscheme == "everforest" then
local ok, everforest = pcall(require, "nord")
if not ok then
return
end
vim.cmd([[colorscheme everforest]])
end
if colorscheme == "dracula" then
local ok, dracula = pcall(require, "dracula")
if not ok then
return
end
dracula.setup({
-- customize dracula color palette
colors = {
bg = "#282A36",
fg = "#F8F8F2",
selection = "#44475A",
comment = "#6272A4",
red = "#FF5555",
orange = "#FFB86C",
yellow = "#F1FA8C",
green = "#50fa7b",
purple = "#BD93F9",
cyan = "#8BE9FD",
pink = "#FF79C6",
bright_red = "#FF6E6E",
bright_green = "#69FF94",
bright_yellow = "#FFFFA5",
bright_blue = "#D6ACFF",
bright_magenta = "#FF92DF",
bright_cyan = "#A4FFFF",
bright_white = "#FFFFFF",
menu = "#21222C",
visual = "#3E4452",
gutter_fg = "#4B5263",
nontext = "#3B4048",
},
-- show the '~' characters after the end of buffers
show_end_of_buffer = true, -- default false
-- use transparent background
transparent_bg = true, -- default false
-- set custom lualine background color
lualine_bg_color = "#44475a", -- default nil
-- set italic comment
italic_comment = true, -- default false
-- overrides the default highlights see `:h synIDattr`
overrides = {
-- Examples
-- NonText = { fg = dracula.colors().white }, -- set NonText fg to white
-- NvimTreeIndentMarker = { link = "NonText" }, -- link to NonText highlight
-- Nothing = {} -- clear highlight of Nothing
},
})
vim.cmd([[colorscheme dracula]])
end

View File

@@ -40,8 +40,8 @@ cmp.setup({
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
--elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
@@ -51,8 +51,8 @@ cmp.setup({
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
--elseif luasnip.jumpable(-1) then
-- luasnip.jump(-1)
else
fallback()
end

47
lua/git-integration.lua Normal file
View File

@@ -0,0 +1,47 @@
local ok, gitsigns = pcall(require, "gitsigns")
if not ok then
return
end
gitsigns.setup({
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
interval = 1000,
follow_files = true,
},
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
yadm = {
enable = false,
},
})

View File

@@ -18,11 +18,6 @@ vim.g.maplocalleader = ";"
-- Command Mode = 'c',
-- Normal mode --
-- Basic commands
bind("n", "<Leader>w", ":w<CR>", opts)
bind("n", "<Leader>e", ":q<CR>", opts)
bind("n", "<Leader>q", ":qa<CR>", opts)
-- Nvim tree
bind("n", "<C-f>", ":NvimTreeToggle<CR>", opts)

View File

@@ -43,10 +43,48 @@ mason_lspconfig.setup_handlers({
},
})
end,
--["rust_analyzer"] = function()
-- local rt_ok, rust_tools = pcall(require, "rust-tools")
-- if rt_ok then
-- rust_tools.setup({})
-- end
--end,
["rust_analyzer"] = function()
local rt_ok, rust_tools = pcall(require, "rust-tools")
if rt_ok then
rust_tools.setup({})
end
end,
})
-- Global mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set("n", "<Leader>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<Leader>q", vim.diagnostic.setloclist)
-- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<Leader>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<Leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<Leader>wl", function()
print(vim.inspect(vim.lsp.buf.list_workLeader_folders()))
end, opts)
vim.keymap.set("n", "<Leader>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set({ "n", "v" }, "<Leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<Leader>f", function()
vim.lsp.buf.format({ async = true })
end, opts)
end,
})

View File

@@ -13,21 +13,21 @@ require("null-ls").setup({
null_ls.builtins.formatting.clang_format,
},
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({
bufnr = bufnr,
filter = function()
return client.name == "null-ls"
end,
})
end,
})
end
end,
--on_attach = function(client, bufnr)
-- if client.supports_method("textDocument/formatting") then
-- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = bufnr,
-- callback = function()
-- vim.lsp.buf.format({
-- bufnr = bufnr,
-- filter = function()
-- return client.name == "null-ls"
-- end,
-- })
-- end,
-- })
-- end
--end,
})

View File

@@ -1,64 +1,76 @@
local ok, packer = pcall(require, "packer")
if not ok then
return
return
end
packer.startup(function(use)
-- Base16 colorscheme
use("RRethy/nvim-base16")
-- Visible indentation
use("lukas-reineke/indent-blankline.nvim")
-- Nord colorscheme
use("shaunsingh/nord.nvim")
-- Git integration
use("lewis6991/gitsigns.nvim")
-- Onedark colorscheme
use("navarasu/onedark.nvim")
-- Transparency enabler
use("xiyaowong/transparent.nvim")
-- Gruvbox colorscheme
use("ellisonleao/gruvbox.nvim")
-- Nord colorscheme
use("shaunsingh/nord.nvim")
-- Catppuccin colorscheme
use({ "catppuccin/nvim", as = "catppuccin" })
-- Dracula colorscheme
use("Mofiqul/dracula.nvim")
-- Plugin manager
use("wbthomason/packer.nvim")
-- Onedark colorscheme
use("navarasu/onedark.nvim")
-- Terminal
use({ "akinsho/toggleterm.nvim", tag = "*" })
-- Gruvbox colorscheme
use("ellisonleao/gruvbox.nvim")
-- File tree
use({ "nvim-tree/nvim-tree.lua", requires = { "nvim-tree/nvim-web-devicons" }, tag = "nightly" })
--Everforest colorscheme
use("sainnhe/everforest")
-- Statusline
use({ "nvim-lualine/lualine.nvim", requires = { "kyazdani42/nvim-web-devicons", opt = true } })
-- Catppuccin colorscheme
use({ "catppuccin/nvim", as = "catppuccin" })
-- Buffer tabs
use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" })
-- Plugin manager
use("wbthomason/packer.nvim")
use({ "nvim-telescope/telescope.nvim", tag = "0.1.x", requires = { { "nvim-lua/plenary.nvim" } } })
-- Terminal
use({ "akinsho/toggleterm.nvim", tag = "*" })
-- LSP manager
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig")
-- File tree
use({ "nvim-tree/nvim-tree.lua", requires = { "nvim-tree/nvim-web-devicons" }, tag = "nightly" })
-- Formatting
use("jose-elias-alvarez/null-ls.nvim")
-- Statusline
use({ "nvim-lualine/lualine.nvim", requires = { "kyazdani42/nvim-web-devicons", opt = true } })
-- Snippets
use("L3MON4D3/LuaSnip") --snippet engine
use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
-- Buffer tabs
use({ "akinsho/bufferline.nvim", tag = "v3.*", requires = "nvim-tree/nvim-web-devicons" })
-- Completions
use("hrsh7th/nvim-cmp") -- The completion plugin
use("hrsh7th/cmp-buffer") -- buffer completions
use("hrsh7th/cmp-path") -- path completions
use("saadparwaiz1/cmp_luasnip") -- snippet completions
use("onsails/lspkind.nvim")
use("hrsh7th/cmp-nvim-lsp")
use({ "nvim-telescope/telescope.nvim", tag = "0.1.x", requires = { { "nvim-lua/plenary.nvim" } } })
-- Syntax highlighting
use("nvim-treesitter/nvim-treesitter")
-- LSP manager
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig")
-- Rust tools
--use("simrat39/rust-tools.nvim")
-- Formatting
use("jose-elias-alvarez/null-ls.nvim")
-- Snippets
use("L3MON4D3/LuaSnip") --snippet engine
use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
-- Completions
use("hrsh7th/nvim-cmp") -- The completion plugin
use("hrsh7th/cmp-buffer") -- buffer completions
use("hrsh7th/cmp-path") -- path completions
use("saadparwaiz1/cmp_luasnip") -- snippet completions
use("onsails/lspkind.nvim")
use("hrsh7th/cmp-nvim-lsp")
-- Syntax highlighting
use("nvim-treesitter/nvim-treesitter")
-- Rust tools
use("simrat39/rust-tools.nvim")
end)

View File

@@ -5,7 +5,7 @@ end
nvim_treesitter.setup({
-- A list of parser names, or "all" (the four listed parsers should always be installed)
ensure_installed = { "c", "help", "lua", "vim", "cpp", "rust" },
ensure_installed = { "c", "lua", "vim", "cpp", "rust" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer

33
lua/transparency.lua Normal file
View File

@@ -0,0 +1,33 @@
local ok, transparency = pcall(require, "transparency")
if not ok then
return
end
transparency.setup({
groups = { -- table: default groups
"Normal",
"NormalNC",
"Comment",
"Constant",
"Special",
"Identifier",
"Statement",
"PreProc",
"Type",
"Underlined",
"Todo",
"String",
"Function",
"Conditional",
"Repeat",
"Operator",
"Structure",
"LineNr",
"NonText",
"SignColumn",
"CursorLineNr",
"EndOfBuffer",
},
extra_groups = {}, -- table: additional groups that should be cleared
exclude_groups = {}, -- table: groups you don't want to clear
})

12
lua/visible-indents.lua Normal file
View File

@@ -0,0 +1,12 @@
local ok, indent_blankline = pcall(require, "indent_blankline")
if not ok then
return
end
vim.cmd([[let g:indent_blankline_char = '¦']])
indent_blankline.setup({
-- for example, context is off by default, use this to turn it on
show_current_context = true,
show_current_context_start = true,
})