This commit is contained in:
Niktia Bykov
2024-01-01 15:42:39 +05:00
commit 982f56d950
60 changed files with 5427 additions and 0 deletions

View File

@ -0,0 +1,33 @@
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
end
npairs.setup {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
}
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })

View File

@ -0,0 +1,7 @@
require("ibl").setup({
scope = {
enabled = true,
show_start = false,
show_end = false,
},
})

View File

@ -0,0 +1,20 @@
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
return
end
bufferline.setup({
options = {
offsets = {
{ filetype = "NvimTree", text = "", padding = 1 },
{ filetype = "neo-tree", text = "", padding = 1 },
{ filetype = "Outline", text = "", padding = 1 },
},
buffer_close_icon = "",
modified_icon = "",
close_icon = "",
max_name_length = 14,
max_prefix_length = 13,
tab_size = 20,
separator_style = "thin",
},
})

View File

@ -0,0 +1,131 @@
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
local snip_status_ok, luasnip = pcall(require, "luasnip")
if not snip_status_ok then
return
end
require("luasnip/loaders/from_vscode").lazy_load()
local check_backspace = function()
local col = vim.fn.col "." - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
end
--   פּ ﯟ   some other good icons
local kind_icons = {
Text = "",
Method = "m",
Function = "",
Constructor = "",
Field = "",
Variable = "",
Class = "",
Interface = "",
Module = "",
Property = "",
Unit = "",
Value = "",
Enum = "",
Keyword = "",
Snippet = "",
Color = "",
File = "",
Reference = "",
Folder = "",
EnumMember = "",
Constant = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
}
-- find more here: https://www.nerdfonts.com/cheat-sheet
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }),
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
["<C-e>"] = cmp.mapping {
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
},
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<CR>"] = cmp.mapping.confirm { select = true },
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- elseif luasnip.expandable() then
-- luasnip.expand()
-- elseif luasnip.expand_or_jumpable() then
-- luasnip.expand_or_jump()
-- elseif check_backspace() then
-- fallback()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
return vim_item
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
window = {
documentation = {
border = { "", "", "", "", "", "", "", "" },
},
},
experimental = {
ghost_text = false,
native_menu = false,
},
}

View File

@ -0,0 +1 @@
vim.g.tokyonight_style = "night"

View File

@ -0,0 +1,45 @@
local dap_status_ok, dap = pcall(require, "dap")
if not dap_status_ok then
return
end
local dapui_status_ok, dapui = pcall(require, "dapui")
if not dapui_status_ok then
return
end
dap.adapters.coreclr = {
type = 'executable',
command = '/usr/local/netcoredbg',
args = {'--interpreter=vscode'}
}
dap.configurations.cs = {
{
type = "coreclr",
name = "launch - netcoredbg",
request = "launch",
program = function()
return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
end,
},
}
vim.keymap.set('n', '<leader>dr', dap.continue)
vim.keymap.set('n', '<leader>dj', dap.step_into)
vim.keymap.set('n', '<leader>dl', dap.step_over)
vim.keymap.set('n', '<leader>dk', dap.step_out)
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint)
vim.keymap.set('n', '<leader>ds', dap.terminate)
--Autostart ui when debugging
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end

View File

@ -0,0 +1,6 @@
local dapui_status_ok, dapui = pcall(require, "dapui")
if not dapui_status_ok then
return
end
dapui.setup()

View File

@ -0,0 +1,42 @@
require('gitsigns').setup {
signs = {
add = { hl = 'GitSignsAdd' , text = '', numhl='GitSignsAddNr' , linehl='GitSignsAddLn' },
change = { hl = 'GitSignsChange', text = '', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn' },
delete = { hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn' },
topdelete = { hl = 'GitSignsDelete', text = '', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn' },
changedelete = { hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn' },
untracked = { hl = 'GitSignsAdd' , text = '', numhl='GitSignsAddNr' , linehl='GitSignsAddLn' },
},
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

@ -0,0 +1,58 @@
local Git = {
condition = conditions.is_git_repo,
init = function(self)
self.status_dict = vim.b.gitsigns_status_dict
self.has_changes = self.status_dict.added ~= 0 or self.status_dict.removed ~= 0 or self.status_dict.changed ~= 0
end,
hl = { fg = "orange" },
{ -- git branch name
provider = function(self)
return "" .. self.status_dict.head
end,
hl = { bold = true },
},
-- You could handle delimiters, icons and counts similar to Diagnostics
{
condition = function(self)
return self.has_changes
end,
provider = "(",
},
{
provider = function(self)
local count = self.status_dict.added or 0
return count > 0 and ("+" .. count)
end,
hl = { fg = "git_add" },
},
{
provider = function(self)
local count = self.status_dict.removed or 0
return count > 0 and ("-" .. count)
end,
hl = { fg = "git_del" },
},
{
provider = function(self)
local count = self.status_dict.changed or 0
return count > 0 and ("~" .. count)
end,
hl = { fg = "git_change" },
},
{
condition = function(self)
return self.has_changes
end,
provider = ")",
},
}
local statusline = { Git }
local winbar = {}
local tabline = {}
require("heirline").setup(statusline, winbar, tabline)

View File

@ -0,0 +1,59 @@
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
local keymap = vim.api.nvim_set_keymap
keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
--window navigation
keymap("n", "<C-h>", "<C-w>h", opts)
keymap("n", "<C-j>", "<C-w>j", opts)
keymap("n", "<C-k>", "<C-w>k", opts)
keymap("n", "<C-l>", "<C-w>l", opts)
-- Resize with arrows
keymap("n", "<C-Up>", ":resize +2<CR>", opts)
keymap("n", "<C-Down>", ":resize -2<CR>", opts)
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
--move text up and down
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
keymap("v", "p", '"_dP', opts)
keymap("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts)
--center when moving with ctrl-u, ctrl-d
keymap("n", "<C-u>", "<C-u>zz", opts)
keymap("n", "<C-d>", "<C-d>zz", opts)
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
-- Navigate buffers
keymap("n", "<S-l>", ":bnext<CR>", opts)
keymap("n", "<S-h>", ":bprevious<CR>", opts)
--Close buffer
keymap("n", "<C-w>", ":bd | bp <CR>", opts)
--Format document
keymap("n", "<leader>F", ":lua vim.lsp.buf.format() <CR>", opts)
keymap("n", "<leader>ff",
"<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>",
opts)
keymap("n", "<leader>fw",
"<cmd>lua require'telescope.builtin'.live_grep()<cr>",
opts)
keymap("n", "<leader>e", ":Neotree toggle <CR>", opts)

View File

@ -0,0 +1,62 @@
local M = {}
-- TODO: backfill this to template
M.setup = function()
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in ipairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
local config = {
-- disable virtual text
-- virtual_text = false,
-- show signs
signs = {
active = signs,
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
}
vim.diagnostic.config(config)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
width = 60,
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
width = 60,
})
end
-- local function lsp_highlight_document(client)
-- -- Set autocommands conditional on server_capabilities
-- local status_ok, illuminate = pcall(require, "illuminate")
-- if not status_ok then
-- return
-- end
-- illuminate.on_attach(client)
-- end
-- M.on_attach = function(client, bufnr)
-- lsp_highlight_document(client)
-- end
return M

View File

@ -0,0 +1,44 @@
local status_ok, mason = pcall(require, "mason")
if not status_ok then
return
end
local status_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not status_ok then
return
end
local status_ok, lspconfig = pcall(require, "lspconfig")
if not status_ok then
return
end
mason.setup()
mason_lspconfig.setup()
local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
vim.api.nvim_set_keymap("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
vim.api.nvim_set_keymap("n", "grr", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
vim.api.nvim_set_keymap("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
-- vim.api.nvim_buf_set_keymap("n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_set_keymap("n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts)
vim.api.nvim_set_keymap(
"n",
"gl",
'<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>',
opts
)
vim.api.nvim_set_keymap("n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
vim.api.nvim_set_keymap("n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]])
require("user.lsp.mason_lsp_config")
require("user.lsp.handlers").setup()

View File

@ -0,0 +1,52 @@
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup_handlers({
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
["omnisharp"] = function()
require("lspconfig")["omnisharp"].setup({
on_attach = function(client, bufnr)
if client.name == "omnisharp" then
client.server_capabilities.semanticTokensProvider = nil
end
end,
})
end,
["pylsp"] = function()
require("lspconfig")["pylsp"].setup({
settings = {
pylsp = {
plugins = {
pycodestyle = {
ignore = { "E501", "E231", "W503" },
maxLineLength = 100,
},
},
},
},
})
end,
["rust_analyzer"] = function()
require("lspconfig")["rust_analyzer"].setup({
settings = {
["rust-analyzer"] = {
cargo = {
allFeatures = true,
},
},
},
})
end,
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({})
end,
-- ["omnisharp"] = function()
-- require("omnisharp").setup({})
-- end,
-- Next, you can provide a dedicated handler for specific servers.
-- For example, a handler override for the `rust_analyzer`:
-- ["rust_analyzer"] = function()
-- require("rust-tools").setup({})
-- end,
})

View File

@ -0,0 +1,182 @@
local schemas = {
{
description = "TypeScript compiler configuration file",
fileMatch = {
"tsconfig.json",
"tsconfig.*.json",
},
url = "https://json.schemastore.org/tsconfig.json",
},
{
description = "Lerna config",
fileMatch = { "lerna.json" },
url = "https://json.schemastore.org/lerna.json",
},
{
description = "Babel configuration",
fileMatch = {
".babelrc.json",
".babelrc",
"babel.config.json",
},
url = "https://json.schemastore.org/babelrc.json",
},
{
description = "ESLint config",
fileMatch = {
".eslintrc.json",
".eslintrc",
},
url = "https://json.schemastore.org/eslintrc.json",
},
{
description = "Bucklescript config",
fileMatch = { "bsconfig.json" },
url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json",
},
{
description = "Prettier config",
fileMatch = {
".prettierrc",
".prettierrc.json",
"prettier.config.json",
},
url = "https://json.schemastore.org/prettierrc",
},
{
description = "Vercel Now config",
fileMatch = { "now.json" },
url = "https://json.schemastore.org/now",
},
{
description = "Stylelint config",
fileMatch = {
".stylelintrc",
".stylelintrc.json",
"stylelint.config.json",
},
url = "https://json.schemastore.org/stylelintrc",
},
{
description = "A JSON schema for the ASP.NET LaunchSettings.json files",
fileMatch = { "launchsettings.json" },
url = "https://json.schemastore.org/launchsettings.json",
},
{
description = "Schema for CMake Presets",
fileMatch = {
"CMakePresets.json",
"CMakeUserPresets.json",
},
url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json",
},
{
description = "Configuration file as an alternative for configuring your repository in the settings page.",
fileMatch = {
".codeclimate.json",
},
url = "https://json.schemastore.org/codeclimate.json",
},
{
description = "LLVM compilation database",
fileMatch = {
"compile_commands.json",
},
url = "https://json.schemastore.org/compile-commands.json",
},
{
description = "Config file for Command Task Runner",
fileMatch = {
"commands.json",
},
url = "https://json.schemastore.org/commands.json",
},
{
description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.",
fileMatch = {
"*.cf.json",
"cloudformation.json",
},
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json",
},
{
description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.",
fileMatch = {
"serverless.template",
"*.sam.json",
"sam.json",
},
url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json",
},
{
description = "Json schema for properties json file for a GitHub Workflow template",
fileMatch = {
".github/workflow-templates/**.properties.json",
},
url = "https://json.schemastore.org/github-workflow-template-properties.json",
},
{
description = "golangci-lint configuration file",
fileMatch = {
".golangci.toml",
".golangci.json",
},
url = "https://json.schemastore.org/golangci-lint.json",
},
{
description = "JSON schema for the JSON Feed format",
fileMatch = {
"feed.json",
},
url = "https://json.schemastore.org/feed.json",
versions = {
["1"] = "https://json.schemastore.org/feed-1.json",
["1.1"] = "https://json.schemastore.org/feed.json",
},
},
{
description = "Packer template JSON configuration",
fileMatch = {
"packer.json",
},
url = "https://json.schemastore.org/packer.json",
},
{
description = "NPM configuration file",
fileMatch = {
"package.json",
},
url = "https://json.schemastore.org/package.json",
},
{
description = "JSON schema for Visual Studio component configuration files",
fileMatch = {
"*.vsconfig",
},
url = "https://json.schemastore.org/vsconfig.json",
},
{
description = "Resume json",
fileMatch = { "resume.json" },
url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
},
}
local opts = {
settings = {
json = {
schemas = schemas,
},
},
setup = {
commands = {
Format = {
function()
vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
end,
},
},
},
}
return opts

View File

@ -0,0 +1,16 @@
return {
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
}

View File

@ -0,0 +1,12 @@
return {
settings = {
python = {
analysis = {
typeCheckingMode = "off",
diagnosticMode = "workspace",
autoSearchPaths = true,
},
},
},
}

View File

@ -0,0 +1,7 @@
require("lsp-format").setup {}
local on_attach = function(client)
require "lsp-format".on_attach(client)
end
require "lspconfig".gopls.setup { on_attach = on_attach }

View File

@ -0,0 +1,40 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'kanagawa',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = true,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@ -0,0 +1,73 @@
-- vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
-- vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
-- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
-- vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
require("neo-tree").setup({
enable_diagnostics = false,
enable_git_status = true,
default_component_configs = {
icon = {
folder_empty = "󰜌",
folder_empty_open = "󰜌",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
},
},
},
document_symbols = {
kinds = {
File = { icon = "󰈙", hl = "Tag" },
Namespace = { icon = "󰌗", hl = "Include" },
Package = { icon = "󰏖", hl = "Label" },
Class = { icon = "󰌗", hl = "Include" },
Property = { icon = "󰆧", hl = "@property" },
Enum = { icon = "󰒻", hl = "@number" },
Function = { icon = "󰊕", hl = "Function" },
String = { icon = "󰀬", hl = "String" },
Number = { icon = "󰎠", hl = "Number" },
Array = { icon = "󰅪", hl = "Type" },
Object = { icon = "󰅩", hl = "Type" },
Key = { icon = "󰌋", hl = "" },
Struct = { icon = "󰌗", hl = "Type" },
Operator = { icon = "󰆕", hl = "Operator" },
TypeParameter = { icon = "󰊄", hl = "Type" },
StaticMethod = { icon = "󰠄 ", hl = "Function" },
},
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "",
staged = "",
conflict = "",
},
},
-- Add this section only if you've configured source selector.
source_selector = {
sources = {
{ source = "filesystem", display_name = " 󰉓 Files " },
{ source = "git_status", display_name = " 󰊢 Git " },
},
},
-- Other options ...
})

View File

@ -0,0 +1,20 @@
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
end
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
debug = false,
sources = {
formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
formatting.black.with({ extra_args = { "--fast" } }),
formatting.isort,
formatting.stylua,
-- diagnostics.flake8
},
})

View File

@ -0,0 +1,6 @@
local null_ls_status_ok, null_ls = pcall(require, "scrollbar")
if not null_ls_status_ok then
return
end
null_ls.setup()

View File

@ -0,0 +1,24 @@
-- examples for your init.lua
-- empty setup using defaults
-- OR setup with some options
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
adaptive_size = false,
width = 22,
height = 22,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})

View File

@ -0,0 +1,8 @@
require("onedark").setup({
style = "darker",
transparent = true,
highlights = {
NvimTreeWinSeparator = {fg ='#aaaaa'}
}
})
require("onedark").load()

View File

@ -0,0 +1,25 @@
vim.opt.backup = false
vim.opt.cmdheight = 1
vim.opt.completeopt = { "menuone", "noselect" }
vim.opt.fileencoding = "utf-8"
vim.opt.ignorecase = true
vim.opt.showtabline = 2
vim.opt.smartindent = true
vim.opt.smartcase = true
vim.opt.splitright = true
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.termguicolors = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.updatetime = 300
vim.opt.ttimeoutlen = 5
vim.api.nvim_create_autocmd("FileType", {
pattern = "cs",
command = "setlocal shiftwidth=4 tabstop=4"
})
vim.cmd "au VimEnter * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'"
vim.cmd "au VimLeave * silent! !xmodmap -e 'clear Lock' -e 'keycode 0x42 = Caps_Lock'"
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format()]]

View File

@ -0,0 +1,140 @@
local fn = vim.fn
-- Automatically install packer
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,
})
print("Installing packer close and reopen Neovim...")
vim.cmd([[packadd packer.nvim]])
end
-- Autocommand that reloads neovim whenever you save the plugins.lua file
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerSync
augroup end
]])
-- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, "packer")
if not status_ok then
return
end
-- Have packer use a popup window
packer.init({
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
})
-- Install your plugins here
return packer.startup(function(use)
-- My plugins here
use("wbthomason/packer.nvim") -- Have packer manage itself
use("nvim-lua/popup.nvim") -- An implementation of the Popup API from vim in Neovim
use("nvim-lua/plenary.nvim") -- Useful lua functions used ny lots of plugins
--colorschemes
use("navarasu/onedark.nvim")
use("morhetz/gruvbox")
use("Mofiqul/dracula.nvim")
use("folke/tokyonight.nvim")
-- use("lunarvim/colorschemes")
use("windwp/nvim-autopairs")
use("hrsh7th/nvim-cmp") -- The completion plugin
use("hrsh7th/cmp-buffer") -- buffer completions
use("hrsh7th/cmp-path") -- path completions
use("hrsh7th/cmp-cmdline") -- cmdline completions
use("saadparwaiz1/cmp_luasnip") -- snippet completions
use("hrsh7th/cmp-nvim-lsp")
-- snippets
use("L3MON4D3/LuaSnip") --snippet engine
use("rafamadriz/friendly-snippets") -- a bunch of snippets to use
use({ "dsznajder/vscode-es7-javascript-react-snippets", run = "yarn install --frozen-lockfile && yarn compile" })
-- LSP
use("williamboman/mason.nvim") -- simple to use language server installer
use("williamboman/mason-lspconfig.nvim")
use("neovim/nvim-lspconfig") -- enable LSP
-- use("williamboman/nvim-lsp-installer") -- simple to use language server installer
use("nvim-treesitter/nvim-treesitter-refactor")
-- file explorer
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
}
}
use({
"kyazdani42/nvim-tree.lua",
requires = {
"kyazdani42/nvim-web-devicons", -- optional, for file icons
},
tag = "nightly", -- optional, updated every week. (see issue #1193)
})
use({ "akinsho/bufferline.nvim", tag = "v2.*", requires = "kyazdani42/nvim-web-devicons" })
use({
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
})
use({
"nvimtools/none-ls.nvim",
})
use("lukas-reineke/lsp-format.nvim")
use("Vimjas/vim-python-pep8-indent")
--telescope
use("nvim-telescope/telescope.nvim")
use("nvim-telescope/telescope-media-files.nvim")
--comment out
use("tpope/vim-commentary")
use("lukas-reineke/indent-blankline.nvim")
use("windwp/nvim-ts-autotag")
use("sickill/vim-monokai")
use("rebelot/kanagawa.nvim")
--scrollbar
use("petertriho/nvim-scrollbar")
--heirline statusbar
use("rebelot/heirline.nvim")
--heirline statusbar
use("lewis6991/gitsigns.nvim")
--debugging
use("mfussenegger/nvim-dap")
use("rcarriga/nvim-dap-ui")
use("nvim-lualine/lualine.nvim")
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if PACKER_BOOTSTRAP then
require("packer").sync()
end
end)

View File

@ -0,0 +1,104 @@
local status_ok, telescope = pcall(require, "telescope")
if not status_ok then
return
end
telescope.load_extension('media_files')
local actions = require "telescope.actions"
telescope.setup {
defaults = {
file_ignore_patterns = { "node_modules", "venv" },
prompt_prefix = "",
selection_caret = "",
path_display = { "smart" },
mappings = {
i = {
["<C-n>"] = actions.cycle_history_next,
["<C-p>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-c>"] = actions.close,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["<C-l>"] = actions.complete_tag,
["<C-_>"] = actions.which_key, -- keys from pressing <C-/>
},
n = {
["<esc>"] = actions.close,
["<CR>"] = actions.select_default,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-t>"] = actions.select_tab,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
["H"] = actions.move_to_top,
["M"] = actions.move_to_middle,
["L"] = actions.move_to_bottom,
["<Down>"] = actions.move_selection_next,
["<Up>"] = actions.move_selection_previous,
["gg"] = actions.move_to_top,
["G"] = actions.move_to_bottom,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
["<PageUp>"] = actions.results_scrolling_up,
["<PageDown>"] = actions.results_scrolling_down,
["?"] = actions.which_key,
},
},
},
pickers = {
-- Default configuration for builtin pickers goes here:
-- picker_name = {
-- picker_config_key = value,
-- ...
-- }
-- Now the picker_config_key will be applied every time you call this
-- builtin picker
},
extensions = {
media_files = {
-- filetypes whitelist
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
filetypes = { "png", "webp", "jpg", "jpeg" },
find_cmd = "rg" -- find command (defaults to `fd`)
}
-- Your extension configuration goes here:
-- extension_name = {
-- extension_config_key = value,
-- }
-- please take a look at the readme of the extension you want to configure
},
}

View File

@ -0,0 +1,24 @@
require("kanagawa").setup({
compile = false, -- enable compiling the colorscheme
undercurl = true, -- enable undercurls
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true },
statementStyle = { bold = true },
typeStyle = {},
transparent = true, -- do not set background color
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
terminalColors = true, -- define vim.g.terminal_color_{0,17}
colors = {
-- add/modify theme and palette colors
palette = {},
theme = { wave = {}, lotus = {}, dragon = {}, all = {} },
},
overrides = function(colors) -- add/modify highlights
return {}
end,
theme = "wave", -- Load "wave" theme when 'background' option is not set
background = { -- map the value of 'background' option to a theme
dark = "wave", -- try "dragon" !
},
})

View File

@ -0,0 +1,34 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup({
ensure_installed = {"python", "rust", "javascript"}, -- one of "all" or a list of languages
ignore_install = { "phpdoc", "comment", "rst" }, -- List of parsers to ignore installing
highlight = {
additional_vim_regex_highlighting = false,
enable = true, -- false will disable the whole extension
disable = { "css" }, -- list of language that will be disabled
},
autopairs = {
enable = true,
},
indent = { enable = true, disable = { "python", "css" } },
autotag = {
enable = true,
},
refactor = {
highlight_definitions = {
enable = false,
-- Set to false if you have an `updatetime` of ~100.
clear_on_cursor_move = true,
},
smart_rename = {
enable = false,
keymaps = {
smart_rename = "grr",
},
},
},
})