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("syntax-highlight")
require("lsp-config") require("lsp-config")
require("lsp-format") require("lsp-format")
require("transparency")
require("visible-indents")
require("git-integration")

View File

@@ -1,31 +1,4 @@
local colorscheme = "base16-black-metal" -- Set colorscheme local colorscheme = "gruvbox" -- Set colorscheme { gruvbox, onedark, catppuccin, nord, dracula }
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
if colorscheme == "onedark" then if colorscheme == "onedark" then
-- Onedark Default Configuration -- Onedark Default Configuration
@@ -138,7 +111,12 @@ if colorscheme == "gruvbox" then
undercurl = true, undercurl = true,
underline = true, underline = true,
bold = true, bold = true,
italic = true, italic = {
strings = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true, strikethrough = true,
invert_selection = false, invert_selection = false,
invert_signs = false, invert_signs = false,
@@ -165,3 +143,64 @@ if colorscheme == "nord" then
vim.cmd([[colorscheme nord]]) vim.cmd([[colorscheme nord]])
end 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() cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region -- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then --elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() -- luasnip.expand_or_jump()
elseif has_words_before() then elseif has_words_before() then
cmp.complete() cmp.complete()
else else
@@ -51,8 +51,8 @@ cmp.setup({
["<S-Tab>"] = cmp.mapping(function(fallback) ["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
elseif luasnip.jumpable(-1) then --elseif luasnip.jumpable(-1) then
luasnip.jump(-1) -- luasnip.jump(-1)
else else
fallback() fallback()
end 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', -- Command Mode = 'c',
-- Normal mode -- -- 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 -- Nvim tree
bind("n", "<C-f>", ":NvimTreeToggle<CR>", opts) bind("n", "<C-f>", ":NvimTreeToggle<CR>", opts)

View File

@@ -43,10 +43,48 @@ mason_lspconfig.setup_handlers({
}, },
}) })
end, end,
--["rust_analyzer"] = function() ["rust_analyzer"] = function()
-- local rt_ok, rust_tools = pcall(require, "rust-tools") local rt_ok, rust_tools = pcall(require, "rust-tools")
-- if rt_ok then if rt_ok then
-- rust_tools.setup({}) rust_tools.setup({})
-- end end
--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, null_ls.builtins.formatting.clang_format,
}, },
-- you can reuse a shared lspconfig on_attach callback here -- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr) --on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then -- if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) -- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", { -- vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup, -- group = augroup,
buffer = bufnr, -- buffer = bufnr,
callback = function() -- callback = function()
vim.lsp.buf.format({ -- vim.lsp.buf.format({
bufnr = bufnr, -- bufnr = bufnr,
filter = function() -- filter = function()
return client.name == "null-ls" -- return client.name == "null-ls"
end, -- end,
}) -- })
end, -- end,
}) -- })
end -- end
end, --end,
}) })

View File

@@ -4,18 +4,30 @@ if not ok then
end end
packer.startup(function(use) packer.startup(function(use)
-- Base16 colorscheme -- Visible indentation
use("RRethy/nvim-base16") use("lukas-reineke/indent-blankline.nvim")
-- Git integration
use("lewis6991/gitsigns.nvim")
-- Transparency enabler
use("xiyaowong/transparent.nvim")
-- Nord colorscheme -- Nord colorscheme
use("shaunsingh/nord.nvim") use("shaunsingh/nord.nvim")
-- Dracula colorscheme
use("Mofiqul/dracula.nvim")
-- Onedark colorscheme -- Onedark colorscheme
use("navarasu/onedark.nvim") use("navarasu/onedark.nvim")
-- Gruvbox colorscheme -- Gruvbox colorscheme
use("ellisonleao/gruvbox.nvim") use("ellisonleao/gruvbox.nvim")
--Everforest colorscheme
use("sainnhe/everforest")
-- Catppuccin colorscheme -- Catppuccin colorscheme
use({ "catppuccin/nvim", as = "catppuccin" }) use({ "catppuccin/nvim", as = "catppuccin" })
@@ -60,5 +72,5 @@ packer.startup(function(use)
use("nvim-treesitter/nvim-treesitter") use("nvim-treesitter/nvim-treesitter")
-- Rust tools -- Rust tools
--use("simrat39/rust-tools.nvim") use("simrat39/rust-tools.nvim")
end) end)

View File

@@ -5,7 +5,7 @@ end
nvim_treesitter.setup({ nvim_treesitter.setup({
-- A list of parser names, or "all" (the four listed parsers should always be installed) -- 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`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
-- Automatically install missing parsers when entering buffer -- 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,
})