Format workspace with CodeFormat

This commit is contained in:
2023-09-02 17:29:59 +02:00
parent 214ffd053d
commit ae3bc212a9
63 changed files with 1205 additions and 1061 deletions
+147
View File
@@ -0,0 +1,147 @@
# see https://github.com/CppCXY/EmmyLuaCodeStyle
[*.lua]
# [basic]
# optional space/tab
indent_style = space
# if indent_style is space, this is valid
indent_size = 4
# if indent_style is tab, this is valid
tab_width = 4
# none/single/double
quote_style = double
continuation_indent = 4
# this mean utf8 length , if this is 'unset' then the line width is no longer checked
# this option decides when to chopdown the code
max_line_length = 120
# optional crlf/lf/cr/auto, if it is 'auto', in windows it is crlf other platforms are lf
# in neovim the value 'auto' is not a valid option, please use 'unset'
end_of_line = lf
# none/ comma / semicolon / only_kv_colon
table_separator_style = comma
#optional keep/never/always/smart
trailing_table_separator = always
# keep/remove/remove_table_only/remove_string_only
call_arg_parentheses = keep
detect_end_of_line = false
# this will check text end with new line
insert_final_newline = true
# [space]
space_around_table_field_list = true
space_before_attribute = true
space_before_function_open_parenthesis = false
space_before_function_call_open_parenthesis = false
space_before_closure_open_parenthesis = true
# optional always/only_string/only_table/none
# or true/false
space_before_function_call_single_arg = always
space_before_open_square_bracket = false
space_inside_function_call_parentheses = false
space_inside_function_param_list_parentheses = false
space_inside_square_brackets = false
# like t[#t+1] = 1
space_around_table_append_operator = false
ignore_spaces_inside_function_call = false
space_before_inline_comment = 1
# [operator space]
space_around_math_operator = true
space_after_comma = true
space_after_comma_in_for_statement = true
space_around_concat_operator = true
# [align]
align_call_args = false
align_function_params = true
align_continuous_assign_statement = true
align_continuous_rect_table_field = true
align_continuous_line_space = 2
align_if_branch = false
# option none / always / contain_curly/
align_array_table = true
align_continuous_similar_call_args = false
align_continuous_inline_comment = true
# option none / always / only_call_stmt
align_chain_expr = none
# [indent]
never_indent_before_if_condition = false
never_indent_comment_on_if_branch = false
keep_indents_on_empty_lines = false
# [line space]
# The following configuration supports four expressions
# keep
# fixed(n)
# min(n)
# max(n)
# for eg. min(2)
line_space_after_if_statement = keep
line_space_after_do_statement = keep
line_space_after_while_statement = keep
line_space_after_repeat_statement = keep
line_space_after_for_statement = keep
line_space_after_local_or_assign_statement = keep
line_space_after_function_statement = fixed(2)
line_space_after_expression_statement = keep
line_space_after_comment = keep
line_space_around_block = fixed(1)
# [line break]
break_all_list_when_line_exceed = false
auto_collapse_lines = false
break_before_braces = false
# [preference]
ignore_space_after_colon = false
remove_call_expression_list_finish_comma = false
end_statement_with_semicolon = keep
+3 -3
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
local files = { 'globals', 'options', 'autocommands', 'mappings' } local files = { "globals", "options", "autocommands", "mappings", }
for _, file in ipairs(files) do for _, file in ipairs(files) do
local pkg = "core." .. file local pkg = "core." .. file
@@ -29,14 +29,14 @@ end
if vim.g.vscode then if vim.g.vscode then
-- VSCode extension -- VSCode extension
else else
local ok, err = pcall(require, 'bootstrap') local ok, err = pcall(require, "bootstrap")
if not ok then if not ok then
print("Error during bootstrap") print("Error during bootstrap")
print(err:gsub("\t", " ")) print(err:gsub("\t", " "))
return return
end end
ok, err = pcall(require, 'plugins') ok, err = pcall(require, "plugins")
if not ok then if not ok then
print("Error while loading plugins") print("Error while loading plugins")
print(err:gsub("\t", " ")) print(err:gsub("\t", " "))
+9 -9
View File
@@ -14,24 +14,24 @@
limitations under the License. limitations under the License.
]] ]]
local utils = require('utils') local utils = require("utils")
-- Install lazy.nvim -- Install lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
if utils.os_name == "Linux" then if utils.os_name == "Linux" then
utils.assert_any_available({ 'curl', 'wget' }) utils.assert_any_available({ "curl", "wget", })
utils.assert_available('unzip') utils.assert_available("unzip")
utils.assert_available('gzip') utils.assert_available("gzip")
elseif utils.os_name == "Windows_NT" then elseif utils.os_name == "Windows_NT" then
utils.assert_any_available({ 'pwsh', 'powershell' }) utils.assert_any_available({ "pwsh", "powershell", })
utils.assert_any_available({ '7z', 'peazip', 'arc', 'wzzip', 'rar' }) utils.assert_any_available({ "7z", "peazip", "arc", "wzzip", "rar", })
else else
error('OS not supported: ' .. utils.os_name) error("OS not supported: " .. utils.os_name)
end end
utils.assert_available('git') utils.assert_available("git")
utils.assert_available('tar') utils.assert_available("tar")
vim.fn.system({ vim.fn.system({
"git", "git",
+10 -10
View File
@@ -17,14 +17,14 @@
require("aerial").setup({ require("aerial").setup({
-- Priority list of preferred backends for aerial. -- Priority list of preferred backends for aerial.
-- This can be a filetype map (see :help aerial-filetype-map) -- This can be a filetype map (see :help aerial-filetype-map)
backends = { "treesitter", "lsp", "markdown" }, backends = { "treesitter", "lsp", "markdown", },
layout = { layout = {
-- These control the width of the aerial window. -- These control the width of the aerial window.
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) -- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a list of mixed types. -- min_width and max_width can be a list of mixed types.
-- max_width = {40, 0.2} means "the lesser of 40 columns or 20% of total" -- max_width = {40, 0.2} means "the lesser of 40 columns or 20% of total"
max_width = { 40, 0.2 }, max_width = { 40, 0.2, },
width = nil, width = nil,
min_width = 40, min_width = 40,
@@ -159,15 +159,15 @@ require("aerial").setup({
-- Call this function when aerial attaches to a buffer. -- Call this function when aerial attaches to a buffer.
-- Useful for setting keymaps. Takes a single `bufnr` argument. -- Useful for setting keymaps. Takes a single `bufnr` argument.
on_attach = function(bufnr) on_attach = function (bufnr)
-- Toggle the aerial window with <leader>a -- Toggle the aerial window with <leader>a
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>at', '<cmd>AerialToggle!<CR>', {}) vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>at", "<cmd>AerialToggle!<CR>", {})
-- Jump forwards/backwards with '{' and '}' -- Jump forwards/backwards with '{' and '}'
vim.api.nvim_buf_set_keymap(bufnr, 'n', '{', '<cmd>AerialPrev<CR>', {}) vim.api.nvim_buf_set_keymap(bufnr, "n", "{", "<cmd>AerialPrev<CR>", {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', '}', '<cmd>AerialNext<CR>', {}) vim.api.nvim_buf_set_keymap(bufnr, "n", "}", "<cmd>AerialNext<CR>", {})
-- Jump up the tree with '[[' or ']]' -- Jump up the tree with '[[' or ']]'
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[[', '<cmd>AerialPrevUp<CR>', {}) vim.api.nvim_buf_set_keymap(bufnr, "n", "[[", "<cmd>AerialPrevUp<CR>", {})
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']]', '<cmd>AerialNextUp<CR>', {}) vim.api.nvim_buf_set_keymap(bufnr, "n", "]]", "<cmd>AerialNextUp<CR>", {})
end, end,
-- Call this function when aerial first sets symbols on a buffer. -- Call this function when aerial first sets symbols on a buffer.
@@ -219,9 +219,9 @@ require("aerial").setup({
-- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total" -- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total"
max_height = 0.9, max_height = 0.9,
height = nil, height = nil,
min_height = { 8, 0.1 }, min_height = { 8, 0.1, },
override = function(conf, source_winid) override = function (conf, source_winid)
-- This is the config that will be passed to nvim_open_win. -- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout -- Change values here to customize the layout
return conf return conf
+60 -60
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
local utils = require 'utils' local utils = require "utils"
local hl_CustomHeader local hl_CustomHeader
local head_cache local head_cache
@@ -24,13 +24,13 @@ local head_cache
--- @param no_ellipsis boolean whether to disable adding '...' at end after truncation --- @param no_ellipsis boolean whether to disable adding '...' at end after truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis) local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis)
return function(str) return function (str)
local win_width = vim.fn.winwidth(0) local win_width = vim.fn.winwidth(0)
if hide_width and win_width < hide_width then if hide_width and win_width < hide_width then
return '' return ""
elseif trunc_width and trunc_len and win_width < trunc_width and #str > elseif trunc_width and trunc_len and win_width < trunc_width and #str >
trunc_len then trunc_len then
return str:sub(1, trunc_len) .. (no_ellipsis and '' or '...') return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...")
end end
return str return str
end end
@@ -40,12 +40,12 @@ end
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation --- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function l_trunc(trunc_len, no_ellipsis) local function l_trunc(trunc_len, no_ellipsis)
return function(str) return function (str)
if #str > trunc_len then if #str > trunc_len then
if no_ellipsis then if no_ellipsis then
return str:sub(#str - trunc_len) return str:sub(#str - trunc_len)
else else
return '...' .. str:sub(#str - trunc_len + 3) return "..." .. str:sub(#str - trunc_len + 3)
end end
else else
return str return str
@@ -57,7 +57,7 @@ end
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation --- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function r_trunc(trunc_len, no_ellipsis) local function r_trunc(trunc_len, no_ellipsis)
return function(str) return function (str)
if #str > trunc_len then if #str > trunc_len then
if no_ellipsis then if no_ellipsis then
return str:sub(1, trunc_len) return str:sub(1, trunc_len)
@@ -65,7 +65,7 @@ local function r_trunc(trunc_len, no_ellipsis)
return str return str
else else
return str:sub(1, trunc_len - 3) .. return str:sub(1, trunc_len - 3) ..
(no_ellipsis and '' or '...') (no_ellipsis and "" or "...")
end end
end end
return str return str
@@ -73,7 +73,7 @@ local function r_trunc(trunc_len, no_ellipsis)
end end
local function short_path(len) local function short_path(len)
return function(str) return function (str)
if #str > len then return vim.fn.pathshorten(str, 1) end if #str > len then return vim.fn.pathshorten(str, 1) end
return str return str
end end
@@ -81,69 +81,69 @@ end
local function header() local function header()
if hl_CustomHeader == nil then if hl_CustomHeader == nil then
local header_hl = require('utils').get_hl('NvimTreeNormal') local header_hl = require("utils").get_hl("NvimTreeNormal")
if header_hl ~= nil then if header_hl ~= nil then
hl_CustomHeader = 'gui=bold guifg=' .. header_hl.foreground .. hl_CustomHeader = "gui=bold guifg=" .. header_hl.foreground ..
' guibg=' .. header_hl.background " guibg=" .. header_hl.background
vim.api.nvim_command('hi CustomHeader ' .. hl_CustomHeader) vim.api.nvim_command("hi CustomHeader " .. hl_CustomHeader)
end end
end end
-- local header = short_path(40)(vim.fn.getcwd()) -- local header = short_path(40)(vim.fn.getcwd())
-- NOTE: Decided not to use this. Probably doesn't work. -- NOTE: Decided not to use this. Probably doesn't work.
local gitdir = vim.fn.FugitiveExtractGitDir(vim.fn.getcwd()) local gitdir = vim.fn.FugitiveExtractGitDir(vim.fn.getcwd())
local text = '' local text = ""
if gitdir == '' then if gitdir == "" then
text = vim.fn.fnamemodify(vim.fn.getcwd(), ':~') text = vim.fn.fnamemodify(vim.fn.getcwd(), ":~")
else else
text = vim.fn.fnamemodify(gitdir, ':~:h') text = vim.fn.fnamemodify(gitdir, ":~:h")
-- text = vim.fn.fnamemodify(vim.fn.FugitiveWorkTree(), ':~') -- text = vim.fn.fnamemodify(vim.fn.FugitiveWorkTree(), ':~')
-- local branch = r_trunc(15, false)(vim.fn.FugitiveHead()) -- local branch = r_trunc(15, false)(vim.fn.FugitiveHead())
local head = vim.fn.FugitiveHead(8, gitdir) local head = vim.fn.FugitiveHead(8, gitdir)
if head == '' then if head == "" then
if head_cache[gitdir] ~= nil then if head_cache[gitdir] ~= nil then
head = head_cache[gitdir] head = head_cache[gitdir]
else else
local f = io.open(gitdir, 'r') local f = io.open(gitdir, "r")
if f then if f then
io.input(f) io.input(f)
local line = io.read('*l') local line = io.read("*l")
local head = line:gsub( local head = line:gsub(
'ref: /refs/(heads/|remotes/|tags/)', '' "ref: /refs/(heads/|remotes/|tags/)", ""
) )
head_cache[gitdir] = head head_cache[gitdir] = head
end end
end end
end end
if head ~= '' then text = text .. '' .. head end if head ~= "" then text = text .. "" .. head end
end end
-- return l_trunc(40-2, false)(short_path(40-2)(text)) -- return l_trunc(40-2, false)(short_path(40-2)(text))
return l_trunc(40 - 2, false)(text) return l_trunc(40 - 2, false)(text)
end end
require('bufferline').setup( require("bufferline").setup(
{ {
options = { options = {
mode = 'buffers', mode = "buffers",
numbers = function(ordinal, id, lower, raise) return '' end, numbers = function (ordinal, id, lower, raise) return "" end,
close_command = 'bdelete %d', -- can be a string | function, see "Mouse actions" close_command = "bdelete %d", -- can be a string | function, see "Mouse actions"
right_mouse_command = 'bdelete %d', -- can be a string | function, see "Mouse actions" right_mouse_command = "bdelete %d", -- can be a string | function, see "Mouse actions"
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions" left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
indicator = { indicator = {
icon = '', -- this should be omitted if indicator style is not 'icon' icon = "", -- this should be omitted if indicator style is not 'icon'
style = 'icon' style = "icon",
}, },
buffer_close_icon = '', buffer_close_icon = "",
modified_icon = '', modified_icon = "",
close_icon = '', close_icon = "",
left_trunc_marker = '', left_trunc_marker = "",
right_trunc_marker = '', right_trunc_marker = "",
--- name_formatter can be used to change the buffer's label in the bufferline. --- name_formatter can be used to change the buffer's label in the bufferline.
--- Please note some names can/will break the --- Please note some names can/will break the
--- bufferline so use this at your discretion knowing that it has --- bufferline so use this at your discretion knowing that it has
--- some limitations that will *NOT* be fixed. --- some limitations that will *NOT* be fixed.
name_formatter = function(buf) -- buf contains: name_formatter = function (buf) -- buf contains:
-- name | str | the basename of the active file -- name | str | the basename of the active file
-- path | str | the full path of the active file -- path | str | the full path of the active file
-- bufnr (buffer only) | int | the number of the active buffer -- bufnr (buffer only) | int | the number of the active buffer
@@ -155,14 +155,14 @@ require('bufferline').setup(
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
truncate_names = true, truncate_names = true,
tab_size = 18, tab_size = 18,
diagnostics = 'nvim_lsp', diagnostics = "nvim_lsp",
diagnostics_update_in_insert = false, diagnostics_update_in_insert = false,
diagnostics_indicator = function(count, _, _, _) diagnostics_indicator = function (count, _, _, _)
return '(' .. count .. ')' return "(" .. count .. ")"
end, end,
-- NOTE: this will be called a lot so don't do any heavy processing here -- NOTE: this will be called a lot so don't do any heavy processing here
custom_filter = function(buf, _) custom_filter = function (buf, _)
local disabled_ft = { 'NvimTree', 'fugitive' } local disabled_ft = { "NvimTree", "fugitive", }
if utils.has_value(disabled_ft, vim.bo[buf].filetype) then if utils.has_value(disabled_ft, vim.bo[buf].filetype) then
return false return false
@@ -172,32 +172,32 @@ require('bufferline').setup(
end, end,
offsets = { offsets = {
{ {
filetype = 'NvimTree', filetype = "NvimTree",
text = 'File Explorer', -- header, text = "File Explorer", -- header,
text_align = 'center', text_align = "center",
seperator = true seperator = true,
-- padding = 1, -- padding = 1,
-- highlight = "CustomHeader", -- highlight = "CustomHeader",
}, },
{ {
filetype = 'fugitive', filetype = "fugitive",
text = 'Fugitive', -- header, text = "Fugitive", -- header,
text_align = 'center', text_align = "center",
seperator = true seperator = true,
-- padding = 1, -- padding = 1,
-- highlight = "CustomHeader", -- highlight = "CustomHeader",
}, },
{ {
filetype = 'aerial', filetype = "aerial",
text = 'Aerial', -- header, text = "Aerial", -- header,
text_align = 'center', text_align = "center",
seperator = true seperator = true,
-- padding = 1, -- padding = 1,
-- highlight = "CustomHeader", -- highlight = "CustomHeader",
} },
}, },
color_icons = true, -- whether or not to add the filetype icon highlights color_icons = true, -- whether or not to add the filetype icon highlights
show_buffer_icons = true, -- disable filetype icons for buffers show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = false, show_buffer_close_icons = false,
show_buffer_default_icon = true, -- whether or not an unrecognised filetype should show a default icon show_buffer_default_icon = true, -- whether or not an unrecognised filetype should show a default icon
show_close_icon = false, show_close_icon = false,
@@ -205,11 +205,11 @@ require('bufferline').setup(
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
-- can also be a table containing 2 custom separators -- can also be a table containing 2 custom separators
-- [focused and unfocused]. eg: { '|', '|' } -- [focused and unfocused]. eg: { '|', '|' }
separator_style = 'thin', -- | "thick" | "thin" | { 'any', 'any' }, separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = true, enforce_regular_tabs = true,
always_show_bufferline = true, always_show_bufferline = true,
hover = { enabled = true, delay = 200, reveal = { 'close' } }, hover = { enabled = true, delay = 200, reveal = { "close", }, },
sort_by = 'id' sort_by = "id",
} },
} }
) )
+11 -11
View File
@@ -15,7 +15,7 @@
]] ]]
local colors = require("catppuccin.palettes").get_palette() -- fetch colors from g:catppuccin_flavour palette local colors = require("catppuccin.palettes").get_palette() -- fetch colors from g:catppuccin_flavour palette
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
require("catppuccin").setup({ require("catppuccin").setup({
compile_path = vim.fn.stdpath("cache") .. "/catppuccin", compile_path = vim.fn.stdpath("cache") .. "/catppuccin",
transparent_background = false, transparent_background = false,
@@ -49,16 +49,16 @@ require("catppuccin").setup({
native_lsp = { native_lsp = {
enabled = true, enabled = true,
virtual_text = { virtual_text = {
errors = { "italic" }, errors = { "italic", },
hints = { "italic" }, hints = { "italic", },
warnings = { "italic" }, warnings = { "italic", },
information = { "italic" }, information = { "italic", },
}, },
underlines = { underlines = {
errors = { "underline" }, errors = { "underline", },
hints = { "underline" }, hints = { "underline", },
warnings = { "underline" }, warnings = { "underline", },
information = { "underline" }, information = { "underline", },
}, },
}, },
-- For more plugins integrations please see https://github.com/catppuccin/nvim#integrations -- For more plugins integrations please see https://github.com/catppuccin/nvim#integrations
@@ -69,8 +69,8 @@ require("catppuccin").setup({
-- TSConstBuiltin = { fg = colors.peach, style = {} }, -- TSConstBuiltin = { fg = colors.peach, style = {} },
-- TSConstant = { fg = colors.sky }, -- TSConstant = { fg = colors.sky },
-- TSComment = { fg = colors.surface2, style = { "italic" } } -- TSComment = { fg = colors.surface2, style = { "italic" } }
['@parameter'] = { style = {} } ["@parameter"] = { style = {}, },
} },
}) })
vim.cmd("colorscheme catppuccin") vim.cmd("colorscheme catppuccin")
+61 -61
View File
@@ -14,73 +14,73 @@
limitations under the License. limitations under the License.
]] ]]
require('Comment').setup( require("Comment").setup(
{ {
---Add a space b/w comment and the line ---Add a space b/w comment and the line
---@type boolean|fun():boolean ---@type boolean|fun():boolean
padding = true, padding = true,
---Whether the cursor should stay at its position ---Whether the cursor should stay at its position
---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat ---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat
---@type boolean ---@type boolean
sticky = true, sticky = true,
---Lines to be ignored while comment/uncomment. ---Lines to be ignored while comment/uncomment.
---Could be a regex string or a function that returns a regex string. ---Could be a regex string or a function that returns a regex string.
---Example: Use '^$' to ignore empty lines ---Example: Use '^$' to ignore empty lines
---@type string|fun():string ---@type string|fun():string
ignore = '^$', ignore = "^$",
---LHS of toggle mappings in NORMAL + VISUAL mode ---LHS of toggle mappings in NORMAL + VISUAL mode
---@type table ---@type table
toggler = { toggler = {
---Line-comment toggle keymap ---Line-comment toggle keymap
line = 'gcc', line = "gcc",
---Block-comment toggle keymap ---Block-comment toggle keymap
block = 'gbc', block = "gbc",
}, },
---LHS of operator-pending mappings in NORMAL + VISUAL mode ---LHS of operator-pending mappings in NORMAL + VISUAL mode
---@type table ---@type table
opleader = { opleader = {
---Line-comment keymap ---Line-comment keymap
line = 'gc', line = "gc",
---Block-comment keymap ---Block-comment keymap
block = 'gb', block = "gb",
}, },
---LHS of extra mappings ---LHS of extra mappings
---@type table ---@type table
extra = { extra = {
---Add comment on the line above ---Add comment on the line above
above = 'gcO', above = "gcO",
---Add comment on the line below ---Add comment on the line below
below = 'gco', below = "gco",
---Add comment at the end of line ---Add comment at the end of line
eol = 'gcA', eol = "gcA",
}, },
---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode ---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode
---@type table ---@type table
mappings = { mappings = {
---Operator-pending mapping ---Operator-pending mapping
---Includes `gcc`, `gbc`, `gc[count]{motion}` and `gb[count]{motion}` ---Includes `gcc`, `gbc`, `gc[count]{motion}` and `gb[count]{motion}`
---NOTE: These mappings can be changed individually by `opleader` and `toggler` config ---NOTE: These mappings can be changed individually by `opleader` and `toggler` config
basic = true, basic = true,
---Extra mapping ---Extra mapping
---Includes `gco`, `gcO`, `gcA` ---Includes `gco`, `gcO`, `gcA`
extra = true, extra = true,
---Extended mapping ---Extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}` ---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
extended = false, extended = false,
}, },
---Pre-hook, called before commenting the line ---Pre-hook, called before commenting the line
---@type fun(ctx: Ctx):string ---@type fun(ctx: Ctx):string
pre_hook = nil, pre_hook = nil,
---Post-hook, called after commenting is done ---Post-hook, called after commenting is done
---@type fun(ctx: Ctx) ---@type fun(ctx: Ctx)
post_hook = nil, post_hook = nil,
} }
) )
+96 -96
View File
@@ -14,108 +14,108 @@
limitations under the License. limitations under the License.
]] ]]
local cb = require'diffview.config'.diffview_callback local cb = require "diffview.config".diffview_callback
require'diffview'.setup { require "diffview".setup {
diff_binaries = false, -- Show diffs for binaries diff_binaries = false, -- Show diffs for binaries
enhanced_diff_hl = true, -- See ':h diffview-config-enhanced_diff_hl' enhanced_diff_hl = true, -- See ':h diffview-config-enhanced_diff_hl'
use_icons = true, -- Requires nvim-web-devicons use_icons = true, -- Requires nvim-web-devicons
icons = { -- Only applies when use_icons is true. icons = { -- Only applies when use_icons is true.
folder_closed = "", folder_closed = "",
folder_open = "", folder_open = "",
},
signs = {
fold_closed = "",
fold_open = "",
},
file_panel = {
position = "left", -- One of 'left', 'right', 'top', 'bottom'
width = 35, -- Only applies when position is 'left' or 'right'
height = 10, -- Only applies when position is 'top' or 'bottom'
listing_style = "tree", -- One of 'list' or 'tree'
tree_options = { -- Only applies when listing_style is 'tree'
flatten_dirs = true, -- Flatten dirs that only contain one single dir
folder_statuses = "only_folded", -- One of 'never', 'only_folded' or 'always'.
}, },
}, signs = {
file_history_panel = { fold_closed = "",
position = "bottom", fold_open = "",
width = 35,
height = 16,
log_options = {
max_count = 256, -- Limit the number of commits
follow = false, -- Follow renames (only for single file)
all = false, -- Include all refs under 'refs/' including HEAD
merges = false, -- List only merge commits
no_merges = false, -- List no merge commits
reverse = false, -- List commits in reverse order
},
},
default_args = { -- Default args prepended to the arg-list for the listed commands
DiffviewOpen = {},
DiffviewFileHistory = {},
},
hooks = {}, -- See ':h diffview-config-hooks'
key_bindings = {
disable_defaults = false, -- Disable the default key bindings
-- The `view` bindings are active in the diff buffers, only when the current
-- tabpage is a Diffview.
view = {
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
["gf"] = cb("goto_file"), -- Open the file in a new split in previous tabpage
["<C-w><C-f>"] = cb("goto_file_split"), -- Open the file in a new split
["<C-w>gf"] = cb("goto_file_tab"), -- Open the file in a new tabpage
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
}, },
file_panel = { file_panel = {
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry position = "left", -- One of 'left', 'right', 'top', 'bottom'
["<down>"] = cb("next_entry"), width = 35, -- Only applies when position is 'left' or 'right'
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry. height = 10, -- Only applies when position is 'top' or 'bottom'
["<up>"] = cb("prev_entry"), listing_style = "tree", -- One of 'list' or 'tree'
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry. tree_options = { -- Only applies when listing_style is 'tree'
["o"] = cb("select_entry"), flatten_dirs = true, -- Flatten dirs that only contain one single dir
["<2-LeftMouse>"] = cb("select_entry"), folder_statuses = "only_folded", -- One of 'never', 'only_folded' or 'always'.
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry. },
["S"] = cb("stage_all"), -- Stage all entries.
["U"] = cb("unstage_all"), -- Unstage all entries.
["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["i"] = cb("listing_style"), -- Toggle between 'list' and 'tree' views
["f"] = cb("toggle_flatten_dirs"), -- Flatten empty subdirectories in tree listing style.
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
}, },
file_history_panel = { file_history_panel = {
["g!"] = cb("options"), -- Open the option panel position = "bottom",
["<C-A-d>"] = cb("open_in_diffview"), -- Open the entry under the cursor in a diffview width = 35,
["y"] = cb("copy_hash"), -- Copy the commit hash of the entry under the cursor height = 16,
["zR"] = cb("open_all_folds"), log_options = {
["zM"] = cb("close_all_folds"), max_count = 256, -- Limit the number of commits
["j"] = cb("next_entry"), follow = false, -- Follow renames (only for single file)
["<down>"] = cb("next_entry"), all = false, -- Include all refs under 'refs/' including HEAD
["k"] = cb("prev_entry"), merges = false, -- List only merge commits
["<up>"] = cb("prev_entry"), no_merges = false, -- List no merge commits
["<cr>"] = cb("select_entry"), reverse = false, -- List commits in reverse order
["o"] = cb("select_entry"), },
["<2-LeftMouse>"] = cb("select_entry"),
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
}, },
option_panel = { default_args = { -- Default args prepended to the arg-list for the listed commands
["<tab>"] = cb("select"), DiffviewOpen = {},
["q"] = cb("close"), DiffviewFileHistory = {},
},
hooks = {}, -- See ':h diffview-config-hooks'
key_bindings = {
disable_defaults = false, -- Disable the default key bindings
-- The `view` bindings are active in the diff buffers, only when the current
-- tabpage is a Diffview.
view = {
["<tab>"] = cb("select_next_entry"), -- Open the diff for the next file
["<s-tab>"] = cb("select_prev_entry"), -- Open the diff for the previous file
["gf"] = cb("goto_file"), -- Open the file in a new split in previous tabpage
["<C-w><C-f>"] = cb("goto_file_split"), -- Open the file in a new split
["<C-w>gf"] = cb("goto_file_tab"), -- Open the file in a new tabpage
["<leader>e"] = cb("focus_files"), -- Bring focus to the files panel
["<leader>b"] = cb("toggle_files"), -- Toggle the files panel.
},
file_panel = {
["j"] = cb("next_entry"), -- Bring the cursor to the next file entry
["<down>"] = cb("next_entry"),
["k"] = cb("prev_entry"), -- Bring the cursor to the previous file entry.
["<up>"] = cb("prev_entry"),
["<cr>"] = cb("select_entry"), -- Open the diff for the selected entry.
["o"] = cb("select_entry"),
["<2-LeftMouse>"] = cb("select_entry"),
["-"] = cb("toggle_stage_entry"), -- Stage / unstage the selected entry.
["S"] = cb("stage_all"), -- Stage all entries.
["U"] = cb("unstage_all"), -- Unstage all entries.
["X"] = cb("restore_entry"), -- Restore entry to the state on the left side.
["R"] = cb("refresh_files"), -- Update stats and entries in the file list.
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["i"] = cb("listing_style"), -- Toggle between 'list' and 'tree' views
["f"] = cb("toggle_flatten_dirs"), -- Flatten empty subdirectories in tree listing style.
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
},
file_history_panel = {
["g!"] = cb("options"), -- Open the option panel
["<C-A-d>"] = cb("open_in_diffview"), -- Open the entry under the cursor in a diffview
["y"] = cb("copy_hash"), -- Copy the commit hash of the entry under the cursor
["zR"] = cb("open_all_folds"),
["zM"] = cb("close_all_folds"),
["j"] = cb("next_entry"),
["<down>"] = cb("next_entry"),
["k"] = cb("prev_entry"),
["<up>"] = cb("prev_entry"),
["<cr>"] = cb("select_entry"),
["o"] = cb("select_entry"),
["<2-LeftMouse>"] = cb("select_entry"),
["<tab>"] = cb("select_next_entry"),
["<s-tab>"] = cb("select_prev_entry"),
["gf"] = cb("goto_file"),
["<C-w><C-f>"] = cb("goto_file_split"),
["<C-w>gf"] = cb("goto_file_tab"),
["<leader>e"] = cb("focus_files"),
["<leader>b"] = cb("toggle_files"),
},
option_panel = {
["<tab>"] = cb("select"),
["q"] = cb("close"),
},
}, },
},
} }
+7 -7
View File
@@ -14,20 +14,20 @@
limitations under the License. limitations under the License.
]] ]]
vim.g.edge_style = 'default' vim.g.edge_style = "default"
vim.g.edge_disable_italic_comment = 0 vim.g.edge_disable_italic_comment = 0
vim.g.edge_enable_italic = 0 vim.g.edge_enable_italic = 0
vim.g.edge_cursor = 'auto' vim.g.edge_cursor = "auto"
vim.g.edge_transparent_background = 0 vim.g.edge_transparent_background = 0
vim.g.edge_menu_selection_background = 'blue' vim.g.edge_menu_selection_background = "blue"
vim.g.edge_spell_foreground = 'none' vim.g.edge_spell_foreground = "none"
vim.g.edge_show_eob = 1 vim.g.edge_show_eob = 1
vim.g.edge_diagnostic_text_highlight = 0 vim.g.edge_diagnostic_text_highlight = 0
vim.g.edge_diagnostic_line_highlight = 1 vim.g.edge_diagnostic_line_highlight = 1
vim.g.edge_diagnostic_virtual_text = 'grey' vim.g.edge_diagnostic_virtual_text = "grey"
vim.g.edge_current_word = 'grey background' vim.g.edge_current_word = "grey background"
vim.g.edge_disable_terminal_colors = 0 vim.g.edge_disable_terminal_colors = 0
vim.g.edge_lightline_disable_bold = 0 vim.g.edge_lightline_disable_bold = 0
vim.g.edge_better_performance = 1 vim.g.edge_better_performance = 1
vim.fn.execute('colorscheme edge') vim.fn.execute("colorscheme edge")
+1 -1
View File
@@ -14,4 +14,4 @@
limitations under the License. limitations under the License.
]] ]]
vim.keymap.set('n', "<leader>gl", ":Flog<CR>", { remap = false, silent = true }) vim.keymap.set("n", "<leader>gl", ":Flog<CR>", { remap = false, silent = true, })
+3 -3
View File
@@ -19,6 +19,6 @@ local function git_status_tab()
vim.fn.execute("leftabove vertical G | vertical resize 60 | set wfw") vim.fn.execute("leftabove vertical G | vertical resize 60 | set wfw")
end end
vim.keymap.set('n', '<leader>gd', ':Gdiffsplit<CR>', { remap = false }) vim.keymap.set("n", "<leader>gd", ":Gdiffsplit<CR>", { remap = false, })
vim.keymap.set('n', '<leader>gg', git_status_tab, { silent = true, remap = false }) vim.keymap.set("n", "<leader>gg", git_status_tab, { silent = true, remap = false, })
vim.keymap.set('n', '<leader>gc', ':G commit<CR>', { remap = false }) vim.keymap.set("n", "<leader>gc", ":G commit<CR>", { remap = false, })
+1 -1
View File
@@ -14,6 +14,6 @@
limitations under the License. limitations under the License.
]] ]]
local gl = require('galaxyline') local gl = require("galaxyline")
-- maybe some other day -- maybe some other day
+13 -13
View File
@@ -14,9 +14,9 @@
limitations under the License. limitations under the License.
]] ]]
require('github-theme').setup( require("github-theme").setup(
{ {
theme_style = 'dimmed', theme_style = "dimmed",
transparent = false, transparent = false,
hide_end_of_buffer = false, hide_end_of_buffer = false,
hide_inactive_statusline = false, hide_inactive_statusline = false,
@@ -24,20 +24,20 @@ require('github-theme').setup(
dev = false, dev = false,
-- styles -- styles
comment_style = 'italic', comment_style = "italic",
function_style = 'NONE', function_style = "NONE",
keyword_style = 'NONE', keyword_style = "NONE",
msg_area_style = 'NONE', msg_area_style = "NONE",
variable_style = 'NONE', variable_style = "NONE",
-- sidebars -- sidebars
sidebars = { sidebars = {
'qf', "qf",
'vista_kind', "vista_kind",
'terminal', "terminal",
'packer', "packer",
'aerial', "aerial",
'NvimTree' "NvimTree",
}, },
-- Change the "hint" color to the "orange" color, and make the "error" color bright red -- Change the "hint" color to the "orange" color, and make the "error" color bright red
+9 -9
View File
@@ -14,9 +14,9 @@
limitations under the License. limitations under the License.
]] ]]
require('gitsigns').setup( require("gitsigns").setup(
{ {
on_attach = function(bufnr) on_attach = function (bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns
local function map(mode, l, r, opts) local function map(mode, l, r, opts)
opts = opts or {} opts = opts or {}
@@ -42,20 +42,20 @@ require('gitsigns').setup(
-- } -- }
-- end -- end
-- ) -- )
map('n', '<leader>gv', gs.select_hunk) map("n", "<leader>gv", gs.select_hunk)
-- map('n', '<C-j>', "&diff ? '<C-j>' : '<cmd>Gitsigns next_hunk<CR>'", {expr=true}) -- map('n', '<C-j>', "&diff ? '<C-j>' : '<cmd>Gitsigns next_hunk<CR>'", {expr=true})
-- map('n', '<C-k>', "&diff ? '<C-k>' : '<cmd>Gitsigns prev_hunk<CR>'", {expr=true}) -- map('n', '<C-k>', "&diff ? '<C-k>' : '<cmd>Gitsigns prev_hunk<CR>'", {expr=true})
map({ 'n', 'v' }, '<leader>gr', ':Gitsigns reset_hunk<CR>') -- gs.reset_hunk() doesn't work with selected lines map({ "n", "v", }, "<leader>gr", ":Gitsigns reset_hunk<CR>") -- gs.reset_hunk() doesn't work with selected lines
map('n', '<leader>g?', gs.preview_hunk) map("n", "<leader>g?", gs.preview_hunk)
map('n', '<leader>gb', function() map("n", "<leader>gb", function ()
gs.blame_line { full = true } gs.blame_line { full = true, }
end) end)
-- map('n', '<leader>gd', gs.diffthis) -- map('n', '<leader>gd', gs.diffthis)
end, end,
signs = { signs = {
-- default -- default
-- untracked = { text = '┆' } -- untracked = { text = '┆' }
untracked = { text = '' } untracked = { text = "", },
} },
} }
) )
+1 -1
View File
@@ -19,6 +19,6 @@ require("indent_blankline").setup({
show_current_context_start = false, show_current_context_start = false,
use_treesitter = true, use_treesitter = true,
show_first_indent_level = true, show_first_indent_level = true,
char = '', char = "",
-- context_char = '┃', -- context_char = '┃',
}) })
+2 -2
View File
@@ -15,8 +15,8 @@
]] ]]
-- more options at https://www.jetbrains.com/lp/mono/ -- more options at https://www.jetbrains.com/lp/mono/
vim.g.indentLine_char = '' vim.g.indentLine_char = ""
-- Disable conceal for some syntax plugins -- Disable conceal for some syntax plugins
vim.g.vim_json_conceal = 0 vim.g.vim_json_conceal = 0
vim.g.markdown_syntax_conceal = 0 vim.g.markdown_syntax_conceal = 0
vim.g.indentLine_fileTypeExclude = { 'NvimTree' } vim.g.indentLine_fileTypeExclude = { "NvimTree", }
+9 -9
View File
@@ -14,19 +14,19 @@
limitations under the License. limitations under the License.
]] ]]
require('kanagawa').setup({ require("kanagawa").setup({
undercurl = true, -- enable undercurls undercurl = true, -- enable undercurls
commentStyle = { italic = true }, commentStyle = { italic = true, },
functionStyle = {}, functionStyle = {},
keywordStyle = {}, keywordStyle = {},
statementStyle = { bold = true }, statementStyle = { bold = true, },
typeStyle = {}, typeStyle = {},
variablebuiltinStyle = {}, variablebuiltinStyle = {},
specialReturn = true, -- special highlight for the return keyword specialReturn = true, -- special highlight for the return keyword
specialException = true, -- special highlight for exception handling keywords specialException = true, -- special highlight for exception handling keywords
transparent = false, -- do not set background color transparent = false, -- do not set background color
dimInactive = true, -- dim inactive window `:h hl-NormalNC` dimInactive = true, -- dim inactive window `:h hl-NormalNC`
globalStatus = true, -- adjust window separators highlight for laststatus=3 globalStatus = true, -- adjust window separators highlight for laststatus=3
colors = {}, colors = {},
overrides = {}, overrides = {},
}) })
+1 -1
View File
@@ -16,6 +16,6 @@
vim.g.lazygit_floating_window_winblend = 0 -- transparency of floating window vim.g.lazygit_floating_window_winblend = 0 -- transparency of floating window
vim.g.lazygit_floating_window_scaling_factor = 0.9 -- scaling factor for floating window vim.g.lazygit_floating_window_scaling_factor = 0.9 -- scaling factor for floating window
vim.g.lazygit_floating_window_corner_chars = { '', '', '', '' } -- customize lazygit popup window corner characters vim.g.lazygit_floating_window_corner_chars = { "", "", "", "", } -- customize lazygit popup window corner characters
vim.g.lazygit_floating_window_use_plenary = 0 -- use plenary.nvim to manage floating window if available vim.g.lazygit_floating_window_use_plenary = 0 -- use plenary.nvim to manage floating window if available
vim.g.lazygit_use_neovim_remote = 1 -- fallback to 0 if neovim-remote is not installed vim.g.lazygit_use_neovim_remote = 1 -- fallback to 0 if neovim-remote is not installed
+40 -40
View File
@@ -20,42 +20,43 @@
--- @param no_ellipsis boolean whether to disable adding '...' at end after truncation --- @param no_ellipsis boolean whether to disable adding '...' at end after truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis) local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis)
return function(str) return function (str)
local win_width = vim.fn.winwidth(0) local win_width = vim.fn.winwidth(0)
if hide_width and win_width < hide_width then return '' if hide_width and win_width < hide_width then
elseif trunc_width and trunc_len and win_width < trunc_width and #str > trunc_len then return ""
return str:sub(1, trunc_len) .. (no_ellipsis and '' or '...') elseif trunc_width and trunc_len and win_width < trunc_width and #str > trunc_len then
return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...")
end
return str
end end
return str
end
end end
--- @param trunc_len number truncates component to trunc_len number of chars --- @param trunc_len number truncates component to trunc_len number of chars
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation --- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function l_trunc(trunc_len, no_ellipsis) local function l_trunc(trunc_len, no_ellipsis)
return function(str) return function (str)
if #str > trunc_len then if #str > trunc_len then
return (no_ellipsis and '' or '...') .. str:sub(-trunc_len, -1) return (no_ellipsis and "" or "...") .. str:sub(-trunc_len, -1)
end
return str
end end
return str
end
end end
--- @param trunc_len number truncates component to trunc_len number of chars --- @param trunc_len number truncates component to trunc_len number of chars
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation --- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly --- return function that can format the component accordingly
local function r_trunc(trunc_len, no_ellipsis) local function r_trunc(trunc_len, no_ellipsis)
return function(str) return function (str)
if #str > trunc_len then if #str > trunc_len then
return str:sub(1, trunc_len) .. (no_ellipsis and '' or '...') return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...")
end
return str
end end
return str
end
end end
local function short_path(len) local function short_path(len)
return function(str) return function (str)
if #str > len then if #str > len then
return vim.fn.pathshorten(str, 1) return vim.fn.pathshorten(str, 1)
end end
@@ -66,39 +67,39 @@ end
local function header() local function header()
local text = short_path(40)(vim.fn.getcwd()) local text = short_path(40)(vim.fn.getcwd())
local branch = r_trunc(15, false)(vim.fn.FugitiveHead()) local branch = r_trunc(15, false)(vim.fn.FugitiveHead())
if branch ~= '' then if branch ~= "" then
text = text .. '' .. branch text = text .. "" .. branch
end end
return text return text
end end
require('lualine').setup ({ require("lualine").setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
-- theme = require('config.nightfox_lualine_custom'), -- theme = require('config.nightfox_lualine_custom'),
theme = 'auto', theme = "auto",
-- theme = "catppuccin", -- theme = "catppuccin",
component_separators = { left = '', right = '' }, component_separators = { left = "", right = "", },
section_separators = { left = '', right = '' }, section_separators = { left = "", right = "", },
disabled_filetypes = { 'NvimTree', 'fugitive' }, disabled_filetypes = { "NvimTree", "fugitive", },
always_divide_middle = true, always_divide_middle = true,
globalstatus = true globalstatus = true,
}, },
sections = { sections = {
lualine_a = { }, lualine_a = {},
lualine_b = { 'mode' }, lualine_b = { "mode", },
lualine_c = { { 'filename', path = 1 }, 'diff', {'diagnostics', sources = {'nvim_lsp'}}}, lualine_c = { { "filename", path = 1, }, "diff", { "diagnostics", sources = { "nvim_lsp", }, }, },
lualine_x = { 'filetype', 'encoding', 'fileformat', 'progress' }, lualine_x = { "filetype", "encoding", "fileformat", "progress", },
lualine_y = { 'location' }, lualine_y = { "location", },
lualine_z = { } lualine_z = {},
}, },
inactive_sections = { inactive_sections = {
lualine_a = { }, lualine_a = {},
lualine_b = { }, lualine_b = {},
lualine_c = { 'filename' }, lualine_c = { "filename", },
lualine_x = { 'location' }, lualine_x = { "location", },
lualine_y = { }, lualine_y = {},
lualine_z = { } lualine_z = {},
}, },
-- tabline = { -- tabline = {
-- lualine_a = { { header } }, -- lualine_a = { { header } },
@@ -108,6 +109,5 @@ require('lualine').setup ({
-- lualine_y = {}, -- lualine_y = {},
-- lualine_z = {} -- lualine_z = {}
-- }, -- },
extensions = { } extensions = {},
}) })
+1 -1
View File
@@ -28,4 +28,4 @@
-- local ai = require("luasnip.nodes.absolute_indexer") -- local ai = require("luasnip.nodes.absolute_indexer")
-- For rafamadriz/friendly-snippets -- For rafamadriz/friendly-snippets
require("luasnip.loaders.from_vscode").lazy_load() require("luasnip.loaders.from_vscode").lazy_load()
+1 -1
View File
@@ -18,7 +18,7 @@ require("mason-lspconfig").setup({
-- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" } -- A list of servers to automatically install if they're not already installed. Example: { "rust_analyzer@nightly", "lua_ls" }
-- This setting has no relation with the `automatic_installation` setting. -- This setting has no relation with the `automatic_installation` setting.
---@type string[] ---@type string[]
ensure_installed = require('lsp'):language_servers(), ensure_installed = require("lsp"):language_servers(),
-- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed. -- Whether servers that are set up (via lspconfig) should be automatically installed if they're not already installed.
-- This setting has no relation with the `ensure_installed` setting. -- This setting has no relation with the `ensure_installed` setting.
+21 -21
View File
@@ -14,41 +14,41 @@
limitations under the License. limitations under the License.
]] ]]
require('material').setup({ require("material").setup({
contrast = { contrast = {
sidebars = false, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree ) sidebars = false, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree )
floating_windows = false, -- Enable contrast for floating windows floating_windows = false, -- Enable contrast for floating windows
line_numbers = false, -- Enable contrast background for line numbers line_numbers = false, -- Enable contrast background for line numbers
sign_column = false, -- Enable contrast background for the sign column sign_column = false, -- Enable contrast background for the sign column
cursor_line = false, -- Enable darker background for the cursor line cursor_line = false, -- Enable darker background for the cursor line
non_current_windows = false, -- Enable darker background for non-current windows non_current_windows = false, -- Enable darker background for non-current windows
popup_menu = false, -- Enable lighter background for the popup menu popup_menu = false, -- Enable lighter background for the popup menu
}, },
italics = { italics = {
comments = false, -- Enable italic comments comments = false, -- Enable italic comments
keywords = false, -- Enable italic keywords keywords = false, -- Enable italic keywords
functions = false, -- Enable italic functions functions = false, -- Enable italic functions
strings = false, -- Enable italic strings strings = false, -- Enable italic strings
variables = false -- Enable italic variables variables = false, -- Enable italic variables
}, },
contrast_filetypes = { -- Specify which filetypes get the contrasted (darker) background contrast_filetypes = { -- Specify which filetypes get the contrasted (darker) background
"terminal", -- Darker terminal background "terminal", -- Darker terminal background
"packer", -- Darker packer background "packer", -- Darker packer background
"qf" -- Darker qf list background "qf", -- Darker qf list background
}, },
high_visibility = { high_visibility = {
lighter = false, -- Enable higher contrast text for lighter style lighter = false, -- Enable higher contrast text for lighter style
darker = false -- Enable higher contrast text for darker style darker = false, -- Enable higher contrast text for darker style
}, },
disable = { disable = {
borders = false, -- Disable borders between verticaly split windows borders = false, -- Disable borders between verticaly split windows
background = false, -- Prevent the theme from setting the background (NeoVim then uses your teminal background) background = false, -- Prevent the theme from setting the background (NeoVim then uses your teminal background)
term_colors = false, -- Prevent the theme from setting terminal colors term_colors = false, -- Prevent the theme from setting terminal colors
eob_lines = false -- Hide the end-of-buffer lines eob_lines = false, -- Hide the end-of-buffer lines
}, },
lualine_style = "default", -- Lualine style ( can be 'stealth' or 'default' ) lualine_style = "default", -- Lualine style ( can be 'stealth' or 'default' )
async_loading = true, -- Load parts of the theme asyncronously for faster startup (turned on by default) async_loading = true, -- Load parts of the theme asyncronously for faster startup (turned on by default)
custom_highlights = {} -- Overwrite highlights with your own custom_highlights = {}, -- Overwrite highlights with your own
}) })
vim.g.material_style = "deep ocean" vim.g.material_style = "deep ocean"
vim.fn.execute("colorscheme material") vim.fn.execute("colorscheme material")
+17 -17
View File
@@ -14,16 +14,16 @@
limitations under the License. limitations under the License.
]] ]]
require('nightfox').setup({ require("nightfox").setup({
options = { options = {
-- Compiled file's destination location -- Compiled file's destination location
compile_path = vim.fn.stdpath("cache") .. "/nightfox", compile_path = vim.fn.stdpath("cache") .. "/nightfox",
compile_file_suffix = "_compiled", -- Compiled file suffix compile_file_suffix = "_compiled", -- Compiled file suffix
transparent = false, -- Disable setting background transparent = false, -- Disable setting background
terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
dim_inactive = false, -- Non focused panes set to alternative background dim_inactive = false, -- Non focused panes set to alternative background
styles = { -- Style to be applied to different syntax groups styles = { -- Style to be applied to different syntax groups
comments = "NONE", -- Value is any valid attr-list value `:help attr-list` comments = "NONE", -- Value is any valid attr-list value `:help attr-list`
functions = "NONE", functions = "NONE",
keywords = "NONE", keywords = "NONE",
numbers = "NONE", numbers = "NONE",
@@ -31,16 +31,16 @@ require('nightfox').setup({
types = "NONE", types = "NONE",
variables = "NONE", variables = "NONE",
}, },
inverse = { -- Inverse highlight for different types inverse = { -- Inverse highlight for different types
match_paren = false, match_paren = false,
visual = false, visual = false,
search = false, search = false,
}, },
modules = { -- List of various plugins and additional options modules = { -- List of various plugins and additional options
cmp = true, cmp = true,
diagnostic = { diagnostic = {
enable = true, enable = true,
background = true background = true,
}, },
gitsigns = true, gitsigns = true,
native_lsp = true, native_lsp = true,
@@ -54,14 +54,14 @@ require('nightfox').setup({
-- By default nightfox links some groups together. `CursorColumn` is one of these groups. When overriding -- By default nightfox links some groups together. `CursorColumn` is one of these groups. When overriding
-- Make sure `link` is cleared to `""` so that the link will be removed. -- Make sure `link` is cleared to `""` so that the link will be removed.
-- see https://github.com/EdenEast/nightfox.nvim/blob/main/lua/nightfox/group/editor.lua -- see https://github.com/EdenEast/nightfox.nvim/blob/main/lua/nightfox/group/editor.lua
Normal = { bg = "palette.bg0", link = "" }, Normal = { bg = "palette.bg0", link = "", },
NormalNC = { bg = "palette.bg0", link = "" }, NormalNC = { bg = "palette.bg0", link = "", },
NormalFloat = { bg = "palette.bg1", link = "" }, NormalFloat = { bg = "palette.bg1", link = "", },
CursorLine = { bg = "palette.bg1", link = "" }, CursorLine = { bg = "palette.bg1", link = "", },
StatusLine = { bg = "palette.bg1", link = "" }, StatusLine = { bg = "palette.bg1", link = "", },
StatusLineNC = { bg = "palette.bg1", link = "" } StatusLineNC = { bg = "palette.bg1", link = "", },
} },
} },
}) })
vim.cmd("colorscheme nightfox") vim.cmd("colorscheme nightfox")
+16 -16
View File
@@ -22,26 +22,26 @@ local bg = Color.from_hex(spec.bg1)
local fg = spec.fg2 local fg = spec.fg2
local function generate_mode(color, amount) local function generate_mode(color, amount)
amount = amount or 0.3 amount = amount or 0.3
local fade = bg:blend(Color.from_hex(color), amount):to_css() local fade = bg:blend(Color.from_hex(color), amount):to_css()
local b = bg:to_css() local b = bg:to_css()
local f = fg local f = fg
return { return {
a = { bg = color, fg = b }, a = { bg = color, fg = b, },
b = { bg = fade, fg = f }, b = { bg = fade, fg = f, },
c = { bg = b, fg = f }, c = { bg = b, fg = f, },
} }
end end
-- stylua: ignore -- stylua: ignore
local nightfox = { local nightfox = {
normal = generate_mode(pal.blue.base), normal = generate_mode(pal.blue.base),
insert = generate_mode(pal.green.base), insert = generate_mode(pal.green.base),
command = generate_mode(pal.yellow.base), command = generate_mode(pal.yellow.base),
visual = generate_mode(pal.magenta.base), visual = generate_mode(pal.magenta.base),
replace = generate_mode(pal.red.base), replace = generate_mode(pal.red.base),
inactive = generate_mode(spec.fg3), inactive = generate_mode(spec.fg3),
} }
return nightfox return nightfox
+1 -1
View File
@@ -19,4 +19,4 @@ vim.g.nord_borders = false
vim.g.nord_disable_background = false vim.g.nord_disable_background = false
vim.g.nord_italic = false vim.g.nord_italic = false
require('nord').set() require("nord").set()
+10 -11
View File
@@ -14,22 +14,21 @@
limitations under the License. limitations under the License.
]] ]]
require('nvim-autopairs').setup({ require("nvim-autopairs").setup({
disable_filetype = { "TelescopePrompt" }, disable_filetype = { "TelescopePrompt", },
disable_in_macro = false, -- disable when recording or executing a macro disable_in_macro = false, -- disable when recording or executing a macro
disable_in_visualblock = false, -- disable when insert after visual block mode disable_in_visualblock = false, -- disable when insert after visual block mode
ignored_next_char = [=[[%w%%%'%[%"%.]]=], ignored_next_char = [=[[%w%%%'%[%"%.]]=],
enable_moveright = true, enable_moveright = true,
enable_afterquote = true, -- add bracket pairs after quote enable_afterquote = true, -- add bracket pairs after quote
enable_check_bracket_line = true, --- check bracket in same line enable_check_bracket_line = true, --- check bracket in same line
enable_bracket_in_quote = true, -- enable_bracket_in_quote = true, --
enable_abbr = false, -- trigger abbreviation enable_abbr = false, -- trigger abbreviation
break_undo = true, -- switch for basic rule break undo sequence break_undo = true, -- switch for basic rule break undo sequence
check_ts = false, check_ts = false,
map_cr = true, map_cr = true,
map_bs = true, -- map the <BS> key map_bs = true, -- map the <BS> key
map_c_h = false, -- Map the <C-h> key to delete a pair map_c_h = false, -- Map the <C-h> key to delete a pair
map_c_w = false, -- map <c-w> to delete a pair if possible map_c_w = false, -- map <c-w> to delete a pair if possible
}) })
-- cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket" -- cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket"
+47 -47
View File
@@ -14,44 +14,44 @@
limitations under the License. limitations under the License.
]] ]]
local has_words_before = function() local has_words_before = function ()
unpack = unpack or table.unpack unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0)) local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end end
local cmp = require('cmp') local cmp = require("cmp")
local luasnip = require('luasnip') local luasnip = require("luasnip")
local lspkind = require('lspkind') local lspkind = require("lspkind")
cmp.setup({ cmp.setup({
enabled = function() enabled = function ()
-- disable completion in comments -- disable completion in comments
local context = require 'cmp.config.context' local context = require "cmp.config.context"
-- keep command mode completion enabled when cursor is in a comment -- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == 'c' then if vim.api.nvim_get_mode().mode == "c" then
return true return true
else else
return not context.in_treesitter_capture('comment') and return not context.in_treesitter_capture("comment") and
not context.in_syntax_group('Comment') not context.in_syntax_group("Comment")
end end
end, end,
completion = { keyword_length = 3 }, completion = { keyword_length = 3, },
snippet = { snippet = {
expand = function(args) expand = function (args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
luasnip.lsp_expand(args.body) -- For `luasnip` users. luasnip.lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end end,
}, },
formatting = { formatting = {
format = function(entry, vim_item) format = function (entry, vim_item)
vim_item = lspkind.cmp_format({ vim_item = lspkind.cmp_format({
mode = 'text', -- show only symbol annotations mode = "text", -- show only symbol annotations
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = ellipsis_char =
'...' -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
-- The function below will be called before any actual modifications from lspkind -- The function below will be called before any actual modifications from lspkind
-- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30))
@@ -64,30 +64,30 @@ cmp.setup({
vim_item.dup = 0 vim_item.dup = 0
return vim_item return vim_item
end end,
}, },
experimental = { ghost_text = true }, experimental = { ghost_text = true, },
mapping = { mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(), ["<C-p>"] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(), ["<C-n>"] = cmp.mapping.select_next_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4), ["<C-d>"] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ["<C-Space>"] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.close(),
['<CR>'] = cmp.mapping( ["<CR>"] = cmp.mapping(
function(fallback) function (fallback)
if cmp.visible() then if cmp.visible() then
cmp.confirm( cmp.confirm(
{ {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true select = true,
} }
) )
-- vim.api.nvim_feedkeys('(', 'i', true) -- vim.api.nvim_feedkeys('(', 'i', true)
else else
fallback() fallback()
end end
end, { 'i', 's' } end, { "i", "s", }
), ),
-- ['<Down>'] = cmp.mapping( -- ['<Down>'] = cmp.mapping(
-- function(fallback) -- function(fallback)
@@ -112,8 +112,8 @@ cmp.setup({
-- end -- end
-- end, { 'i', 's' } -- end, { 'i', 's' }
-- ), -- ),
['<Tab>'] = cmp.mapping( ["<Tab>"] = cmp.mapping(
function(fallback) function (fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls within expand_or_locally_jumpable() -- You could replace the expand_or_jumpable() calls within expand_or_locally_jumpable()
@@ -125,11 +125,11 @@ cmp.setup({
else else
fallback() fallback()
end end
end, { 'i', 's' } end, { "i", "s", }
), ),
['<S-Tab>'] = cmp.mapping( ["<S-Tab>"] = cmp.mapping(
function(fallback) 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
@@ -137,20 +137,20 @@ cmp.setup({
else else
fallback() fallback()
end end
end, { 'i', 's' } end, { "i", "s", }
) ),
}, },
sources = { sources = {
-- { name = 'buffer' }, -- { name = 'buffer' },
{ name = 'path' }, { name = "path", },
{ name = 'nvim_lsp' }, { name = "nvim_lsp", },
-- { name = 'nvim_lsp_signature_help' }, -- { name = 'nvim_lsp_signature_help' },
-- { name = 'nvim_lua' }, -- { name = 'nvim_lua' },
-- { name = 'vsnip' }, -- For vsnip users. -- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' } -- For luasnip users. { name = "luasnip", }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users. -- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users. -- { name = 'snippy' }, -- For snippy users.
} },
}) })
-- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu -- see https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance#how-to-add-visual-studio-code-dark-theme-colors-to-the-menu
-- -- gray -- -- gray
@@ -171,26 +171,26 @@ cmp.setup({
-- vim.fn.execute("highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4") -- vim.fn.execute("highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4")
cmp.setup.cmdline( cmp.setup.cmdline(
'/', "/",
{ {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { { name = 'buffer' } } sources = { { name = "buffer", }, },
} }
) )
cmp.setup.cmdline( cmp.setup.cmdline(
':', ":",
{ {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources( sources = cmp.config.sources(
{ { name = 'path' } }, { { name = "path", }, },
{ { name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } } } { { name = "cmdline", option = { ignore_cmds = { "Man", "!", }, }, }, }
) ),
} }
) )
local cmp_autopairs = require('nvim-autopairs.completion.cmp') local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on( cmp.event:on(
'confirm_done', "confirm_done",
cmp_autopairs.on_confirm_done() cmp_autopairs.on_confirm_done()
) )
+4 -5
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
require('nvim_comment').setup({ require("nvim_comment").setup({
-- Linters prefer comment and line to have a space in between markers -- Linters prefer comment and line to have a space in between markers
marker_padding = true, marker_padding = true,
-- should comment out empty or whitespace only lines -- should comment out empty or whitespace only lines
@@ -26,8 +26,7 @@ require('nvim_comment').setup({
-- Visual/Operator mapping left hand side -- Visual/Operator mapping left hand side
-- operator_mapping = "<leader>c", -- operator_mapping = "<leader>c",
-- Hook function to call before commenting takes place -- Hook function to call before commenting takes place
hook = nil hook = nil,
}) })
vim.keymap.set('n', '<leader>c', ':CommentToggle<CR>') vim.keymap.set("n", "<leader>c", ":CommentToggle<CR>")
vim.keymap.set('v', '<leader>c', ":'<, '>CommentToggle<CR>") vim.keymap.set("v", "<leader>c", ":'<, '>CommentToggle<CR>")
+37 -37
View File
@@ -15,43 +15,43 @@
]] ]]
require("dapui").setup({ require("dapui").setup({
icons = { expanded = "", collapsed = "" }, icons = { expanded = "", collapsed = "", },
mappings = {
-- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>" },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
layouts = {
{
elements = {
'scopes',
'breakpoints',
'stacks',
'watches',
},
size = 40,
position = 'left',
},
{
elements = {
'repl',
'console',
},
size = 10,
position = 'bottom',
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = { mappings = {
close = { "q", "<Esc>" }, -- Use a table to apply multiple mappings
expand = { "<CR>", "<2-LeftMouse>", },
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
}, },
}, layouts = {
windows = { indent = 1 }, {
elements = {
"scopes",
"breakpoints",
"stacks",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
floating = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = {
close = { "q", "<Esc>", },
},
},
windows = { indent = 1, },
}) })
+22 -22
View File
@@ -26,7 +26,7 @@ vim.fn.execute("nnoremap <silent> <leader>db :lua require'dap'.toggle_breakpoint
vim.fn.execute("nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>") vim.fn.execute("nnoremap <silent> <leader>dr :lua require'dap'.repl.open()<CR>")
-- vim.fn.execute("nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>") -- vim.fn.execute("nnoremap <silent> <leader>dl :lua require'dap'.run_last()<CR>")
local utils = require('utils') local utils = require("utils")
M = {} M = {}
@@ -34,14 +34,14 @@ local env_ok = false
local dap = nil local dap = nil
local function check_env() local function check_env()
local debugpy = utils.exec('python -m debugpy --version') local debugpy = utils.exec("python -m debugpy --version")
assert(debugpy.rc == 0, 'Python module debugpy is required') assert(debugpy.rc == 0, "Python module debugpy is required")
env_ok = true env_ok = true
end end
local function load_dap() local function load_dap()
local ok, p = pcall(require, 'dap') local ok, p = pcall(require, "dap")
assert(ok, 'nvim-dap is required') assert(ok, "nvim-dap is required")
return p return p
end end
@@ -52,44 +52,44 @@ local function start(config)
if not dap then if not dap then
dap = load_dap() dap = load_dap()
dap.adapters.python = { dap.adapters.python = {
type = 'executable'; type = "executable",
command = 'python'; command = "python",
args = { '-m', 'debugpy.adapter' }; args = { "-m", "debugpy.adapter", },
cwd = vim.fn.getcwd(); cwd = vim.fn.getcwd(),
} }
end end
dap.run(config) dap.run(config)
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events -- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
-- Also see :h dap-extensions -- Also see :h dap-extensions
dap.listeners.after['event_initialized']['nvim-dap.lua'] = function() dap.listeners.after["event_initialized"]["nvim-dap.lua"] = function ()
dap.set_exception_breakpoints({ 'userUnhandled' }) dap.set_exception_breakpoints({ "userUnhandled", })
end end
end end
function M.launch(args) function M.launch(args)
assert(type(args) == 'table', 'Args not specified or of wrong type') assert(type(args) == "table", "Args not specified or of wrong type")
local config = { local config = {
name = 'Launch file', name = "Launch file",
type = 'python', type = "python",
request = 'launch', request = "launch",
program = "${file}"; program = "${file}",
-- python = 'python'; -- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest'; -- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
console = "integratedTerminal", console = "integratedTerminal",
args = args args = args,
} }
start(config) start(config)
end end
function M.pytest(args) function M.pytest(args)
assert(type(args) == 'table', 'Args not specified or of wrong type') assert(type(args) == "table", "Args not specified or of wrong type")
local config = { local config = {
name = 'pytest ' .. table.concat(args, ' '), name = "pytest " .. table.concat(args, " "),
type = 'python', type = "python",
request = 'launch', request = "launch",
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python', -- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
module = 'pytest', module = "pytest",
-- python = 'python'; -- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest'; -- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
args = args, args = args,
+7 -7
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
local nvim_tree = require('nvim-tree') local nvim_tree = require("nvim-tree")
nvim_tree.setup({ nvim_tree.setup({
auto_reload_on_write = true, auto_reload_on_write = true,
@@ -121,7 +121,7 @@ nvim_tree.setup({
}, },
}, },
}, },
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md", },
symlink_destination = true, symlink_destination = true,
}, },
hijack_directories = { hijack_directories = {
@@ -132,7 +132,7 @@ nvim_tree.setup({
enable = true, enable = true,
update_root = true, update_root = true,
ignore_list = { ignore_list = {
'help' "help",
}, },
}, },
-- ignore_ft_on_setup = {}, -- ignore_ft_on_setup = {},
@@ -193,8 +193,8 @@ nvim_tree.setup({
enable = true, enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = { exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" }, filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },
buftype = { "nofile", "terminal", "help" }, buftype = { "nofile", "terminal", "help", },
}, },
}, },
}, },
@@ -226,5 +226,5 @@ nvim_tree.setup({
}, },
}) })
local opts = { remap = false, silent = true } local opts = { remap = false, silent = true, }
vim.keymap.set('n', "<leader>tt", function() nvim_tree.toggle(false, true) end, opts) vim.keymap.set("n", "<leader>tt", function () nvim_tree.toggle(false, true) end, opts)
+4 -4
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
require('nvim-treesitter.configs').setup({ require("nvim-treesitter.configs").setup({
-- One of "all", "maintained" (parsers with maintainers), or a list of languages -- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = { ensure_installed = {
"bash", "bash",
@@ -40,21 +40,21 @@ require('nvim-treesitter.configs').setup({
}, },
indent = { indent = {
enable = true enable = true,
}, },
-- Install languages synchronously (only applied to `ensure_installed`) -- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
-- List of parsers to ignore installing -- List of parsers to ignore installing
ignore_install = { }, ignore_install = {},
highlight = { highlight = {
-- `false` will disable the whole extension -- `false` will disable the whole extension
enable = true, enable = true,
-- list of language that will be disabled -- list of language that will be disabled
disable = { }, disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time. -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
+17 -17
View File
@@ -14,36 +14,36 @@
limitations under the License. limitations under the License.
]] ]]
require('onedark').setup { require("onedark").setup {
-- Main options -- -- Main options --
style = 'darker', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
transparent = false, -- Show/hide background transparent = false, -- Show/hide background
term_colors = true, -- Change terminal color as per the selected theme style term_colors = true, -- Change terminal color as per the selected theme style
ending_tildes = true, -- Show the end-of-buffer tildes. By default they are hidden ending_tildes = true, -- Show the end-of-buffer tildes. By default they are hidden
-- toggle theme style --- -- toggle theme style ---
toggle_style_key = '<leader>ts', -- Default keybinding to toggle toggle_style_key = "<leader>ts", -- Default keybinding to toggle
toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light", }, -- List of styles to toggle between
-- Change code style --- -- Change code style ---
-- Options are italic, bold, underline, none -- Options are italic, bold, underline, none
-- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold' -- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold'
code_style = { code_style = {
comments = 'italic', comments = "italic",
keywords = 'none', keywords = "none",
functions = 'none', functions = "none",
strings = 'none', strings = "none",
variables = 'none' variables = "none",
}, },
-- Custom Highlights -- -- Custom Highlights --
colors = {}, -- Override default colors colors = {}, -- Override default colors
highlights = {}, -- Override highlight groups highlights = {}, -- Override highlight groups
-- Plugins Config -- -- Plugins Config --
diagnostics = { diagnostics = {
darker = true, -- darker colors for diagnostic darker = true, -- darker colors for diagnostic
undercurl = true, -- use undercurl instead of underline for diagnostics undercurl = true, -- use undercurl instead of underline for diagnostics
background = true, -- use background color for virtual text background = true, -- use background color for virtual text
}, },
} }
require('onedark').load() require("onedark").load()
+31 -31
View File
@@ -18,16 +18,16 @@ vim.g.symbols_outline = {
highlight_hovered_item = true, highlight_hovered_item = true,
show_guides = true, show_guides = true,
auto_preview = true, auto_preview = true,
position = 'left', position = "left",
relative_width = true, relative_width = true,
width = 25, width = 25,
auto_close = false, auto_close = false,
show_numbers = true, show_numbers = true,
show_relative_numbers = true, show_relative_numbers = true,
show_symbol_details = true, show_symbol_details = true,
preview_bg_highlight = 'Pmenu', preview_bg_highlight = "Pmenu",
keymaps = { -- These keymaps can be a string or a table for multiple keys keymaps = { -- These keymaps can be a string or a table for multiple keys
close = {"<Esc>", "q"}, close = { "<Esc>", "q", },
goto_location = "<Cr>", goto_location = "<Cr>",
focus_location = "o", focus_location = "o",
hover_symbol = "<C-space>", hover_symbol = "<C-space>",
@@ -38,32 +38,32 @@ vim.g.symbols_outline = {
lsp_blacklist = {}, lsp_blacklist = {},
symbol_blacklist = {}, symbol_blacklist = {},
symbols = { symbols = {
File = {icon = "", hl = "TSURI"}, File = { icon = "", hl = "TSURI", },
Module = {icon = "", hl = "TSNamespace"}, Module = { icon = "", hl = "TSNamespace", },
Namespace = {icon = "", hl = "TSNamespace"}, Namespace = { icon = "", hl = "TSNamespace", },
Package = {icon = "", hl = "TSNamespace"}, Package = { icon = "", hl = "TSNamespace", },
Class = {icon = "𝓒", hl = "TSType"}, Class = { icon = "𝓒", hl = "TSType", },
Method = {icon = "ƒ", hl = "TSMethod"}, Method = { icon = "ƒ", hl = "TSMethod", },
Property = {icon = "", hl = "TSMethod"}, Property = { icon = "", hl = "TSMethod", },
Field = {icon = "", hl = "TSField"}, Field = { icon = "", hl = "TSField", },
Constructor = {icon = "", hl = "TSConstructor"}, Constructor = { icon = "", hl = "TSConstructor", },
Enum = {icon = "", hl = "TSType"}, Enum = { icon = "", hl = "TSType", },
Interface = {icon = "", hl = "TSType"}, Interface = { icon = "", hl = "TSType", },
Function = {icon = "", hl = "TSFunction"}, Function = { icon = "", hl = "TSFunction", },
Variable = {icon = "", hl = "TSConstant"}, Variable = { icon = "", hl = "TSConstant", },
Constant = {icon = "", hl = "TSConstant"}, Constant = { icon = "", hl = "TSConstant", },
String = {icon = "𝓐", hl = "TSString"}, String = { icon = "𝓐", hl = "TSString", },
Number = {icon = "#", hl = "TSNumber"}, Number = { icon = "#", hl = "TSNumber", },
Boolean = {icon = "", hl = "TSBoolean"}, Boolean = { icon = "", hl = "TSBoolean", },
Array = {icon = "", hl = "TSConstant"}, Array = { icon = "", hl = "TSConstant", },
Object = {icon = "⦿", hl = "TSType"}, Object = { icon = "⦿", hl = "TSType", },
Key = {icon = "🔐", hl = "TSType"}, Key = { icon = "🔐", hl = "TSType", },
Null = {icon = "NULL", hl = "TSType"}, Null = { icon = "NULL", hl = "TSType", },
EnumMember = {icon = "", hl = "TSField"}, EnumMember = { icon = "", hl = "TSField", },
Struct = {icon = "𝓢", hl = "TSType"}, Struct = { icon = "𝓢", hl = "TSType", },
Event = {icon = "🗲", hl = "TSType"}, Event = { icon = "🗲", hl = "TSType", },
Operator = {icon = "+", hl = "TSOperator"}, Operator = { icon = "+", hl = "TSOperator", },
TypeParameter = {icon = "𝙏", hl = "TSParameter"} TypeParameter = { icon = "𝙏", hl = "TSParameter", },
} },
} }
vim.api.nvim_set_keymap('n', '<leader>o', ':SymbolsOutlineOpen<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<leader>o", ":SymbolsOutlineOpen<CR>", { noremap = true, silent = true, })
+9 -9
View File
@@ -14,25 +14,25 @@
limitations under the License. limitations under the License.
]] ]]
local builtin = require('telescope.builtin') local builtin = require("telescope.builtin")
vim.keymap.set( vim.keymap.set(
'n', '<leader>ff', function() builtin.find_files({ hidden = true }) end, "n", "<leader>ff", function () builtin.find_files({ hidden = true, }) end,
{ remap = false } { remap = false, }
) )
vim.keymap.set( vim.keymap.set(
'n', '<leader>fr', function() builtin.oldfiles({ hidden = true }) end, "n", "<leader>fr", function () builtin.oldfiles({ hidden = true, }) end,
{ remap = false } { remap = false, }
) )
vim.keymap.set( vim.keymap.set(
'n', '<leader>fg', function() "n", "<leader>fg", function ()
builtin.live_grep( builtin.live_grep(
{ additional_args = function(_) return { '--hidden' } end } { additional_args = function (_) return { "--hidden", } end, }
) )
end, { remap = false } end, { remap = false, }
) )
vim.keymap.set( vim.keymap.set(
'n', '<leader>fb', function() builtin.buffers() end, { remap = false } "n", "<leader>fb", function () builtin.buffers() end, { remap = false, }
) )
--[[ local telescope = require('telescope') --[[ local telescope = require('telescope')
+1 -1
View File
@@ -18,7 +18,7 @@ vim.g.tokyonight_style = "night"
vim.g.tokyonight_terminal_colors = true vim.g.tokyonight_terminal_colors = true
vim.g.tokyonight_italic_comments = true vim.g.tokyonight_italic_comments = true
vim.g.tokyonight_italic_keywords = true vim.g.tokyonight_italic_keywords = true
vim.g.tokyonight_sidebars = {'packer', 'terminal'} vim.g.tokyonight_sidebars = { "packer", "terminal", }
vim.g.tokyonight_dark_sidebar = true vim.g.tokyonight_dark_sidebar = true
vim.g.tokyonight_dark_float = true vim.g.tokyonight_dark_float = true
vim.g.tokyonight_lualine_bold = true vim.g.tokyonight_lualine_bold = true
+4 -4
View File
@@ -20,8 +20,8 @@
-- vim.g.UltiSnipsExpandTrigger="<Tab>" -- vim.g.UltiSnipsExpandTrigger="<Tab>"
-- vim.g.UltiSnipsJumpForwardTrigger="<C-l>" -- vim.g.UltiSnipsJumpForwardTrigger="<C-l>"
-- vim.g.UltiSnipsJumpBackwardTrigger="<C-h>" -- vim.g.UltiSnipsJumpBackwardTrigger="<C-h>"
vim.g.UltiSnipsExpandTrigger = '<Plug>(ultisnips_expand)' vim.g.UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
vim.g.UltiSnipsJumpForwardTrigger = '<Plug>(ultisnips_jump_forward)' vim.g.UltiSnipsJumpForwardTrigger = "<Plug>(ultisnips_jump_forward)"
vim.g.UltiSnipsJumpBackwardTrigger = '<Plug>(ultisnips_jump_backward)' vim.g.UltiSnipsJumpBackwardTrigger = "<Plug>(ultisnips_jump_backward)"
vim.g.UltiSnipsListSnippets = '<c-x><c-s>' vim.g.UltiSnipsListSnippets = "<c-x><c-s>"
vim.g.UltiSnipsRemoveSelectModeMappings = 0 vim.g.UltiSnipsRemoveSelectModeMappings = 0
+3 -4
View File
@@ -14,8 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
vim.g.vista_sidebar_position = 'vertical topleft' vim.g.vista_sidebar_position = "vertical topleft"
vim.g.vista_icon_indent = { "╰─▸ ", "├─▸ " }
vim.g.vista_default_executive = 'nvim_lsp'
vim.g.vista_icon_indent = { "╰─▸ ", "├─▸ ", }
vim.g.vista_default_executive = "nvim_lsp"
+4 -4
View File
@@ -24,8 +24,8 @@
-- vim.fn.execute("colorscheme vscode") -- vim.fn.execute("colorscheme vscode")
-- local c = require('vscode.colors') -- local c = require('vscode.colors')
require('vscode').setup({ require("vscode").setup({
style = 'dark', style = "dark",
-- Enable transparent background -- Enable transparent background
transparent = false, transparent = false,
@@ -46,7 +46,7 @@ require('vscode').setup({
-- this supports the same val table as vim.api.nvim_set_hl -- this supports the same val table as vim.api.nvim_set_hl
-- use colors from this colorscheme by requiring vscode.colors! -- use colors from this colorscheme by requiring vscode.colors!
-- Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true }, -- Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
} },
}) })
require('vscode').load() require("vscode").load()
+2 -2
View File
@@ -18,5 +18,5 @@ vim.g.winresizer_vert_resize = "5"
vim.g.winresizer_horiz_resize = "5" vim.g.winresizer_horiz_resize = "5"
vim.g.winresizer_start_key = "" vim.g.winresizer_start_key = ""
local opts = { remap = false, silent = true } local opts = { remap = false, silent = true, }
vim.keymap.set('n', "<C-W>r", ":WinResizerStartResize<CR>", opts) vim.keymap.set("n", "<C-W>r", ":WinResizerStartResize<CR>", opts)
+1 -1
View File
@@ -14,4 +14,4 @@
limitations under the License. limitations under the License.
]] ]]
vim.keymap.set('n', '<C-W>m', ':WinShift<CR>', { remap = false }) vim.keymap.set("n", "<C-W>m", ":WinShift<CR>", { remap = false, })
+7 -7
View File
@@ -18,11 +18,11 @@ local function term_close()
-- Split previous buffer, switching to it -- Split previous buffer, switching to it
vim.fn.execute("split " .. vim.fn.expand("#")) vim.fn.execute("split " .. vim.fn.expand("#"))
-- Close previous window (terminal) -- Close previous window (terminal)
vim.fn.execute(vim.fn.winnr("#") .. "wincmd q") vim.fn.execute(vim.fn.winnr("#") .. "wincmd q")
end end
vim.api.nvim_create_autocmd("TermClose", { vim.api.nvim_create_autocmd("TermClose", {
pattern = "term://*", pattern = "term://*",
callback = term_close callback = term_close,
}) })
local function my_hl() local function my_hl()
@@ -47,19 +47,19 @@ local function my_hl()
-- highlight semshiErrorChar ctermfg=231 guifg=#ffffff ctermbg=160 guibg=#d70000 -- highlight semshiErrorChar ctermfg=231 guifg=#ffffff ctermbg=160 guibg=#d70000
-- sign define semshiError text=E> texthl=semshiErrorSign -- sign define semshiError text=E> texthl=semshiErrorSign
end end
vim.api.nvim_create_augroup("my_colors", { clear = true }) vim.api.nvim_create_augroup("my_colors", { clear = true, })
vim.api.nvim_create_autocmd("ColorScheme", { vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*", pattern = "*",
callback = my_hl, callback = my_hl,
group = "my_colors" group = "my_colors",
}) })
vim.api.nvim_create_autocmd("FileType", { vim.api.nvim_create_autocmd("FileType", {
pattern = "go", pattern = "go",
callback = function() callback = function ()
vim.opt_local.tabstop = 4 vim.opt_local.tabstop = 4
vim.opt_local.expandtab = false vim.opt_local.expandtab = false
vim.opt_local.listchars = 'tab:▏ ' vim.opt_local.listchars = "tab:▏ "
vim.opt_local.list = true vim.opt_local.list = true
end end,
}) })
+6 -6
View File
@@ -14,15 +14,15 @@
limitations under the License. limitations under the License.
]] ]]
vim.g.is_win = vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1 vim.g.is_win = vim.fn.has("win32") == 1 or vim.fn.has("win64") == 1
vim.g.is_linux = vim.fn.has('unix') == 1 and vim.fn.has('win64') ~= 1 vim.g.is_linux = vim.fn.has("unix") == 1 and vim.fn.has("win64") ~= 1
vim.g.is_mac = vim.fn.has('macunix') == 1 vim.g.is_mac = vim.fn.has("macunix") == 1
if vim.fn.executable('python3') then if vim.fn.executable("python3") then
if vim.g.is_win then if vim.g.is_win then
vim.g.python3_host_prog=string.gsub(vim.fn.exepath('python3'), '.exe$', '') vim.g.python3_host_prog = string.gsub(vim.fn.exepath("python3"), ".exe$", "")
elseif vim.g.is_linux or vim.g.is_mac then elseif vim.g.is_linux or vim.g.is_mac then
vim.g.python3_host_prog=vim.fn.exepath('python3') vim.g.python3_host_prog = vim.fn.exepath("python3")
end end
else else
error("Python 3 executable not found! You must install Python 3 and set its PATH correctly!") error("Python 3 executable not found! You must install Python 3 and set its PATH correctly!")
+38 -38
View File
@@ -14,67 +14,67 @@
limitations under the License. limitations under the License.
]] ]]
local opts = { remap = false, silent = true } local opts = { remap = false, silent = true, }
local opts_expr = { remap = false, silent = true, expr = true } local opts_expr = { remap = false, silent = true, expr = true, }
--- Tab mappings --- --- Tab mappings ---
-- vim.keymap.set('n', "tn", ":tabnew <BAR> NvimTreeOpen<CR>", opts) -- vim.keymap.set('n', "tn", ":tabnew <BAR> NvimTreeOpen<CR>", opts)
vim.keymap.set('n', "tn", ":tabnew<CR>", opts) vim.keymap.set("n", "tn", ":tabnew<CR>", opts)
vim.keymap.set('n', "tq", ":tabclose<CR>", opts) vim.keymap.set("n", "tq", ":tabclose<CR>", opts)
-- switch tabs with Ctrl+PgUp/Ctrl+PgDwn (default vim mapping) -- switch tabs with Ctrl+PgUp/Ctrl+PgDwn (default vim mapping)
--- Window mappings --- --- Window mappings ---
vim.keymap.set('n', "<A-h>", ":wincmd h<CR>", opts) vim.keymap.set("n", "<A-h>", ":wincmd h<CR>", opts)
vim.keymap.set('n', "<A-j>", ":wincmd j<CR>", opts) vim.keymap.set("n", "<A-j>", ":wincmd j<CR>", opts)
vim.keymap.set('n', "<A-k>", ":wincmd k<CR>", opts) vim.keymap.set("n", "<A-k>", ":wincmd k<CR>", opts)
vim.keymap.set('n', "<A-l>", ":wincmd l<CR>", opts) vim.keymap.set("n", "<A-l>", ":wincmd l<CR>", opts)
-- Open new window in horizontal split -- Open new window in horizontal split
vim.keymap.set('n', "<C-w>h", ":new<CR>", opts) vim.keymap.set("n", "<C-w>h", ":new<CR>", opts)
-- Open new window in vertical split -- Open new window in vertical split
vim.keymap.set('n', "<C-w>v", ":vnew<CR>", opts) vim.keymap.set("n", "<C-w>v", ":vnew<CR>", opts)
-- Open new window in horizontal split at bottom -- Open new window in horizontal split at bottom
vim.keymap.set('n', "<C-w><leader>", ":bo new<CR>", opts) vim.keymap.set("n", "<C-w><leader>", ":bo new<CR>", opts)
-- Close buffer and window -- Close buffer and window
vim.keymap.set('n', "<C-w>q", ":bd<CR>", opts) vim.keymap.set("n", "<C-w>q", ":bd<CR>", opts)
--- Buffer mappings --- --- Buffer mappings ---
-- Navigate up/down half a screen -- Navigate up/down half a screen
vim.keymap.set({'n', 'v'}, "<C-j>", "<C-d>", opts) vim.keymap.set({ "n", "v", }, "<C-j>", "<C-d>", opts)
vim.keymap.set({'n', 'v'}, "<C-k>", "<C-u>", opts) vim.keymap.set({ "n", "v", }, "<C-k>", "<C-u>", opts)
-- Center cursorline -- Center cursorline
vim.keymap.set('n', "<C-Space>", "zz", opts) vim.keymap.set("n", "<C-Space>", "zz", opts)
-- Save buffer -- Save buffer
vim.keymap.set('n', "<C-s>", ":w<CR>", opts) vim.keymap.set("n", "<C-s>", ":w<CR>", opts)
-- Cycle buffers -- Cycle buffers
vim.keymap.set('n', "<C-End>", ":BufferLineCycleNext<CR>", opts) vim.keymap.set("n", "<C-End>", ":BufferLineCycleNext<CR>", opts)
vim.keymap.set('n', "<C-Home>", ":BufferLineCyclePrev<CR>", opts) vim.keymap.set("n", "<C-Home>", ":BufferLineCyclePrev<CR>", opts)
-- Close buffer without closing window -- Close buffer without closing window
vim.keymap.set('n', "<leader>q", ":bp<bar>sp<bar>bn<bar>bd<CR>", opts) vim.keymap.set("n", "<leader>q", ":bp<bar>sp<bar>bn<bar>bd<CR>", opts)
--- General mappings --- --- General mappings ---
-- Remap some swedish keys for easier use -- Remap some swedish keys for easier use
vim.keymap.set('n', "ö", "}", { remap = true }) vim.keymap.set("n", "ö", "}", { remap = true, })
vim.keymap.set('v', "ö", "}", { remap = true }) vim.keymap.set("v", "ö", "}", { remap = true, })
vim.keymap.set('n', "ä", "{", { remap = true }) vim.keymap.set("n", "ä", "{", { remap = true, })
vim.keymap.set('v', "ä", "{", { remap = true }) vim.keymap.set("v", "ä", "{", { remap = true, })
vim.keymap.set('n', ",", "]", { remap = true }) vim.keymap.set("n", ",", "]", { remap = true, })
vim.keymap.set('n', ".", "[", { remap = true }) vim.keymap.set("n", ".", "[", { remap = true, })
-- yank/put using named register -- yank/put using named register
vim.keymap.set('n', '<leader>y', '"0y', opts) vim.keymap.set("n", "<leader>y", '"0y', opts)
vim.keymap.set('v', '<leader>y', '"0y', opts) vim.keymap.set("v", "<leader>y", '"0y', opts)
vim.keymap.set('n', '<leader>p', '"0p', opts) vim.keymap.set("n", "<leader>p", '"0p', opts)
vim.keymap.set('v', '<leader>p', '"0p', opts) vim.keymap.set("v", "<leader>p", '"0p', opts)
-- Allow exiting insert mode in terminal by hitting <ESC> -- Allow exiting insert mode in terminal by hitting <ESC>
vim.keymap.set('t', "<Esc>", "<C-\\><C-n>", opts) vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", opts)
-- Navigate forward/backwards -- Navigate forward/backwards
vim.keymap.set('n', "<C-l>", "<C-i>", opts) vim.keymap.set("n", "<C-l>", "<C-i>", opts)
vim.keymap.set('n', "<C-h>", "<C-o>", opts) vim.keymap.set("n", "<C-h>", "<C-o>", opts)
-- Use :diffput/get instead of normal one to allow staging visual selection -- Use :diffput/get instead of normal one to allow staging visual selection
vim.keymap.set('n', "<leader>dp", "&diff ? ':diffput<CR>' : '<leader>dp'", opts_expr) vim.keymap.set("n", "<leader>dp", "&diff ? ':diffput<CR>' : '<leader>dp'", opts_expr)
vim.keymap.set('v', "<leader>dp", "&diff ? ':diffput<CR>' : '<leader>dp'", opts_expr) vim.keymap.set("v", "<leader>dp", "&diff ? ':diffput<CR>' : '<leader>dp'", opts_expr)
vim.keymap.set('n', "<leader>do", "&diff ? ':diffget<CR>' : '<leader>do'", opts_expr) vim.keymap.set("n", "<leader>do", "&diff ? ':diffget<CR>' : '<leader>do'", opts_expr)
vim.keymap.set('v', "<leader>do", "&diff ? ':diffget<CR>' : '<leader>do'", opts_expr) vim.keymap.set("v", "<leader>do", "&diff ? ':diffget<CR>' : '<leader>do'", opts_expr)
-- Remove default mappings -- Remove default mappings
vim.keymap.set('', "<C-LeftMouse>", "") vim.keymap.set("", "<C-LeftMouse>", "")
vim.keymap.set('', "q", "") vim.keymap.set("", "q", "")
+4 -4
View File
@@ -35,7 +35,7 @@ vim.opt.foldlevelstart = 99
vim.opt.foldmethod = "indent" vim.opt.foldmethod = "indent"
vim.opt.foldignore = "" vim.opt.foldignore = ""
vim.opt.guifont = "JetBrains Mono:11" vim.opt.guifont = "JetBrains Mono:11"
vim.opt.completeopt:append({ "menu", "menuone", "preview", "noinsert" }) vim.opt.completeopt:append({ "menu", "menuone", "preview", "noinsert", })
-- Max number of items -- Max number of items
vim.opt.pumheight = 20 vim.opt.pumheight = 20
-- pseudo transparency for completion menu -- pseudo transparency for completion menu
@@ -44,7 +44,7 @@ vim.opt.pumblend = 10
vim.opt.winblend = 5 vim.opt.winblend = 5
-- set nowrap -- set nowrap
vim.opt.clipboard:append("unnamedplus") vim.opt.clipboard:append("unnamedplus")
vim.opt.matchpairs:append({ "<:>", "':'", "\":\"" }) vim.opt.matchpairs:append({ "<:>", "':'", "\":\"", })
vim.opt.fileencoding = "utf-8" vim.opt.fileencoding = "utf-8"
-- Only relevant with wrap enabled (default) -- Only relevant with wrap enabled (default)
vim.opt.linebreak = true vim.opt.linebreak = true
@@ -61,7 +61,7 @@ vim.opt.undofile = true
-- kspell is only relevant if ':set spell' is toggled on, e.g. when editing -- kspell is only relevant if ':set spell' is toggled on, e.g. when editing
-- documents -- documents
vim.opt.complete:append("kspell") vim.opt.complete:append("kspell")
vim.opt.complete:remove({ "w", "b", "u", "t" }) vim.opt.complete:remove({ "w", "b", "u", "t", })
vim.opt.spelllang = "en" vim.opt.spelllang = "en"
-- Align indent to next multiple value of shiftwidth. -- Align indent to next multiple value of shiftwidth.
-- E.g., only insert as many spaces necessary for reaching the next shiftwidth -- E.g., only insert as many spaces necessary for reaching the next shiftwidth
@@ -83,7 +83,7 @@ vim.opt.diffopt:append("closeoff")
vim.opt.diffopt:append("internal") vim.opt.diffopt:append("internal")
-- These make diffs easier to read, please see the following: -- These make diffs easier to read, please see the following:
-- https://vimways.org/2018/the-power-of-diff/ -- https://vimways.org/2018/the-power-of-diff/
vim.opt.diffopt:append({ "indent-heuristic", "algorithm:histogram" }) vim.opt.diffopt:append({ "indent-heuristic", "algorithm:histogram", })
vim.fn.execute("filetype plugin on") vim.fn.execute("filetype plugin on")
vim.opt.hlsearch = false vim.opt.hlsearch = false
vim.opt.laststatus = 3 vim.opt.laststatus = 3
+3 -3
View File
@@ -17,7 +17,7 @@
-- requires shellcheck also (for linting) -- requires shellcheck also (for linting)
return { return {
cmd = { 'bash-language-server', 'start' }, cmd = { "bash-language-server", "start", },
cmd_env = { GLOB_PATTERN = '*@(.sh|.inc|.bash|.command)' }, cmd_env = { GLOB_PATTERN = "*@(.sh|.inc|.bash|.command)", },
single_file_support = true single_file_support = true,
} }
+5 -5
View File
@@ -16,10 +16,10 @@
return { return {
cmd = { cmd = {
'clangd', "clangd",
'--clang-tidy', "--clang-tidy",
'--enable-config', "--enable-config",
'--log=verbose' "--log=verbose",
}, },
single_file_support = true, single_file_support = true,
} }
+3 -3
View File
@@ -15,9 +15,9 @@
]] ]]
return { return {
cmd = { 'cmake-language-server' }, cmd = { "cmake-language-server", },
single_file_support = true, single_file_support = true,
init_options = { init_options = {
buildDirectory = "build" buildDirectory = "build",
} },
} }
+88 -88
View File
@@ -15,162 +15,162 @@
]] ]]
return { return {
cmd = { 'diagnostic-languageserver', '--stdio' }, cmd = { "diagnostic-languageserver", "--stdio", },
single_file_support = true, single_file_support = true,
-- For more info see https://github.com/iamcco/diagnostic-languageserver -- For more info see https://github.com/iamcco/diagnostic-languageserver
init_options = { init_options = {
filetypes = { python = 'flake8', lua = 'luaFormatter' }, filetypes = { python = "flake8", lua = "luaFormatter", },
linters = { linters = {
-- some help from this: -- some help from this:
-- https://github.com/creativenull/diagnosticls-configs-nvim/blob/main/lua/diagnosticls-configs/linters/flake8.lua -- https://github.com/creativenull/diagnosticls-configs-nvim/blob/main/lua/diagnosticls-configs/linters/flake8.lua
flake8 = { flake8 = {
command = 'flake8', command = "flake8",
args = { args = {
'--config', "--config",
'tox.ini', "tox.ini",
'--format', "--format",
'%(row)d,%(col)d,%(code).1s,%(code)s: %(text)s', "%(row)d,%(col)d,%(code).1s,%(code)s: %(text)s",
'-' "-",
}, },
rootPatterns = { 'Pipfile', '.git', 'tox.ini' }, rootPatterns = { "Pipfile", ".git", "tox.ini", },
isStdout = true, isStdout = true,
isStderr = false, isStderr = false,
debounce = 100, debounce = 100,
offsetLine = 0, offsetLine = 0,
offsetColumn = 0, offsetColumn = 0,
sourceName = 'flake8', sourceName = "flake8",
formatLines = 1, formatLines = 1,
formatPattern = { formatPattern = {
[[(\d+),(\d+),([A-Z]),(.*)(\r|\n)*$]], [[(\d+),(\d+),([A-Z]),(.*)(\r|\n)*$]],
{ line = 1, column = 2, security = 3, message = { 4 } } { line = 1, column = 2, security = 3, message = { 4, }, },
}, },
securities = { securities = {
-- Available securities are { 'error', 'warning', 'hint', 'info' } -- Available securities are { 'error', 'warning', 'hint', 'info' }
E = 'error', E = "error",
W = 'warning', W = "warning",
B = 'hint', B = "hint",
F = 'error', F = "error",
D = 'info' D = "info",
} },
} },
}, },
formatFiletypes = { formatFiletypes = {
python = { 'black', 'isort' }, python = { "black", "isort", },
lua = { 'luaFormatter' }, lua = { "luaFormatter", },
sh = { 'shfmt' } sh = { "shfmt", },
}, },
formatters = { formatters = {
black = { black = {
sourceName = 'black', sourceName = "black",
command = 'black', command = "black",
args = { args = {
'--stdin-filename', "--stdin-filename",
'%filename', "%filename",
'-t', "-t",
'py39', "py39",
'--quiet', "--quiet",
'-' "-",
}, },
rootPatterns = { 'Pipfile', '.git', 'tox.ini' }, rootPatterns = { "Pipfile", ".git", "tox.ini", },
isStdout = true, isStdout = true,
isStderr = false, isStderr = false,
ignoreExitCode = false ignoreExitCode = false,
}, },
isort = { isort = {
sourceName = 'isort', sourceName = "isort",
command = 'isort', command = "isort",
args = { '--quiet', '-' }, args = { "--quiet", "-", },
rootPatterns = { 'Pipfile', '.git', 'tox.ini' }, rootPatterns = { "Pipfile", ".git", "tox.ini", },
isStdout = true, isStdout = true,
isStderr = false, isStderr = false,
ignoreExitCode = false ignoreExitCode = false,
}, },
luaFormatter = { luaFormatter = {
sourceName = 'luaFormatter', sourceName = "luaFormatter",
command = 'lua-format', command = "lua-format",
isStdout = true, isStdout = true,
isStderr = false, isStderr = false,
ignoreExitCode = false, ignoreExitCode = false,
args = { args = {
'--column-limit', "--column-limit",
'80', -- Column limit of one line "80", -- Column limit of one line
'--indent-width', "--indent-width",
'4', -- Number of spaces used for indentation "4", -- Number of spaces used for indentation
-- '--use-tab', -- Use tab for indentation -- '--use-tab', -- Use tab for indentation
'--no-use-tab', -- Do not use tab for indentation "--no-use-tab", -- Do not use tab for indentation
'--tab-width', "--tab-width",
'4', -- Number of spaces used per tab "4", -- Number of spaces used per tab
'--continuation-indent-width', "--continuation-indent-width",
'4', -- Indent width for continuations line "4", -- Indent width for continuations line
'--spaces-before-call', "--spaces-before-call",
'1', -- Space on function calls "1", -- Space on function calls
'--keep-simple-control-block-one-line', -- Keep block in one line "--keep-simple-control-block-one-line", -- Keep block in one line
-- '--no-keep-simple-control-block-one-line', -- Do not keep block in one line -- '--no-keep-simple-control-block-one-line', -- Do not keep block in one line
'--keep-simple-function-one-line', -- Keep function in one line "--keep-simple-function-one-line", -- Keep function in one line
-- '--no-keep-simple-function-one-line', -- Do not keep function in one line -- '--no-keep-simple-function-one-line', -- Do not keep function in one line
'--align-args', -- Align the arguments "--align-args", -- Align the arguments
-- '--no-align-args', -- Do not align the arguments -- '--no-align-args', -- Do not align the arguments
'--break-after-functioncall-lp', -- Break after '(' of function call "--break-after-functioncall-lp", -- Break after '(' of function call
-- '--no-break-after-functioncall-lp', -- Do not break after '(' of function call -- '--no-break-after-functioncall-lp', -- Do not break after '(' of function call
'--break-before-functioncall-rp', -- Break before ')' of function call "--break-before-functioncall-rp", -- Break before ')' of function call
-- '--no-break-before-functioncall-rp', -- Do not break before ')' of function call -- '--no-break-before-functioncall-rp', -- Do not break before ')' of function call
-- '--spaces-inside-functioncall-parens', -- Put spaces on the inside of parens in function calls -- '--spaces-inside-functioncall-parens', -- Put spaces on the inside of parens in function calls
'--no-spaces-inside-functioncall-parens', -- Do not put spaces on the inside of parens in function calls "--no-spaces-inside-functioncall-parens", -- Do not put spaces on the inside of parens in function calls
-- '--spaces-inside-functiondef-parens', -- Put spaces on the inside of parens in function headers -- '--spaces-inside-functiondef-parens', -- Put spaces on the inside of parens in function headers
'--no-spaces-inside-functiondef-parens', -- Do not put spaces on the inside of parens in function headers "--no-spaces-inside-functiondef-parens", -- Do not put spaces on the inside of parens in function headers
'--align-parameter', -- Align the parameters "--align-parameter", -- Align the parameters
-- '--no-align-parameter', -- Do not align the parameters -- '--no-align-parameter', -- Do not align the parameters
'--chop-down-parameter', -- Chop down all parameters "--chop-down-parameter", -- Chop down all parameters
-- '--no-chop-down-parameter', -- Do not chop down all parameters -- '--no-chop-down-parameter', -- Do not chop down all parameters
'--break-after-functiondef-lp', -- Break after '(' of function def "--break-after-functiondef-lp", -- Break after '(' of function def
-- '--no-break-after-functiondef-lp', -- Do not break after '(' of function def -- '--no-break-after-functiondef-lp', -- Do not break after '(' of function def
'--break-before-functiondef-rp', -- Break before ')' of function def "--break-before-functiondef-rp", -- Break before ')' of function def
-- '--no-break-before-functiondef-rp', -- Do not break before ')' of function def -- '--no-break-before-functiondef-rp', -- Do not break before ')' of function def
'--align-table-field', -- Align fields of table "--align-table-field", -- Align fields of table
-- '--no-align-table-field', -- Do not align fields of table -- '--no-align-table-field', -- Do not align fields of table
'--break-after-table-lb', -- Break after '{' of table "--break-after-table-lb", -- Break after '{' of table
-- '--no-break-after-table-lb', -- Do not break after '{' of table -- '--no-break-after-table-lb', -- Do not break after '{' of table
'--break-before-table-rb', -- Break before '}' of table "--break-before-table-rb", -- Break before '}' of table
-- '--no-break-before-table-rb', -- Do not break before '}' of table -- '--no-break-before-table-rb', -- Do not break before '}' of table
'--chop-down-table', -- Chop down any table "--chop-down-table", -- Chop down any table
-- '--no-chop-down-table', -- Do not chop down any table -- '--no-chop-down-table', -- Do not chop down any table
'--chop-down-kv-table', -- Chop down table if table contains key "--chop-down-kv-table", -- Chop down table if table contains key
-- '--no-chop-down-kv-table', -- Do not chop down table if table contains key -- '--no-chop-down-kv-table', -- Do not chop down table if table contains key
'--table-sep', "--table-sep",
',', -- Character to separate table fields ",", -- Character to separate table fields
'--column-table-limit', "--column-table-limit",
'80', -- Column limit of each line of a table "80", -- Column limit of each line of a table
-- '--extra-sep-at-table-end', -- Add a extra field separator -- '--extra-sep-at-table-end', -- Add a extra field separator
'--no-extra-sep-at-table-end', -- Do not add a extra field separator "--no-extra-sep-at-table-end", -- Do not add a extra field separator
'--spaces-inside-table-braces', -- Put spaces on the inside of braces in table constructors "--spaces-inside-table-braces", -- Put spaces on the inside of braces in table constructors
-- '--no-spaces-inside-table-braces', -- Do not put spaces on the inside of braces in table constructors -- '--no-spaces-inside-table-braces', -- Do not put spaces on the inside of braces in table constructors
'--break-after-operator', -- Put break after operators "--break-after-operator", -- Put break after operators
-- '--no-break-after-operator', -- Do not put break after operators -- '--no-break-after-operator', -- Do not put break after operators
'--double-quote-to-single-quote', -- Transform string literals to use single quote "--double-quote-to-single-quote", -- Transform string literals to use single quote
-- '--no-double-quote-to-single-quote', -- Do not transform string literals to use single quote -- '--no-double-quote-to-single-quote', -- Do not transform string literals to use single quote
-- '--single-quote-to-double-quote', -- Transform string literals to use double -- '--single-quote-to-double-quote', -- Transform string literals to use double
'--no-single-quote-to-double-quote', -- Do not transform string literals to use double "--no-single-quote-to-double-quote", -- Do not transform string literals to use double
'--spaces-around-equals-in-field', -- Put spaces around the equal sign in key/value fields "--spaces-around-equals-in-field", -- Put spaces around the equal sign in key/value fields
-- '--no-spaces-around-equals-in-field', -- Do not put spaces around the equal sign in key/value fields -- '--no-spaces-around-equals-in-field', -- Do not put spaces around the equal sign in key/value fields
'--line-breaks-after-function-body', "--line-breaks-after-function-body",
'1', -- Line brakes after function body "1", -- Line brakes after function body
'--line-separator', "--line-separator",
'input' -- input(determined by the input content), "input", -- input(determined by the input content),
-- os(Use line ending of the current Operating system), -- os(Use line ending of the current Operating system),
-- lf(Unix style "\n"), -- lf(Unix style "\n"),
-- crlf(Windows style "\r\n"), -- crlf(Windows style "\r\n"),
-- cr(classic Max style "\r") -- cr(classic Max style "\r")
} },
}, },
shfmt = { shfmt = {
sourceName = 'shfmt', sourceName = "shfmt",
command = 'shfmt', command = "shfmt",
args = { '-s', '-i', '4', '-ci' }, args = { "-s", "-i", "4", "-ci", },
rootPatterns = { 'Pipfile', '.git', 'tox.ini' }, rootPatterns = { "Pipfile", ".git", "tox.ini", },
isStdout = true, isStdout = true,
isStderr = false, isStderr = false,
ignoreExitCode = false ignoreExitCode = false,
} },
} },
} },
} }
+4 -4
View File
@@ -15,8 +15,8 @@
]] ]]
return { return {
cmd = { "golangci-lint-langserver" }, cmd = { "golangci-lint-langserver", },
init_options = { init_options = {
command = { "golangci-lint", "run", "--out-format", "json" } command = { "golangci-lint", "run", "--out-format", "json", },
} },
} }
+7 -7
View File
@@ -15,7 +15,7 @@
]] ]]
return { return {
cmd = { "gopls", "serve" }, cmd = { "gopls", "serve", },
-- https://github.com/golang/tools/blob/master/gopls/doc/settings.md -- https://github.com/golang/tools/blob/master/gopls/doc/settings.md
settings = { settings = {
gopls = { gopls = {
@@ -27,7 +27,7 @@ return {
run_vulncheck_exp = true, run_vulncheck_exp = true,
tidy = true, tidy = true,
upgrade_dependency = true, upgrade_dependency = true,
vendor = true vendor = true,
}, },
usePlaceholders = true, usePlaceholders = true,
analyses = { analyses = {
@@ -77,8 +77,8 @@ return {
undeclaredname = true, undeclaredname = true,
unusedvariable = true, unusedvariable = true,
fillstruct = true, fillstruct = true,
stubmethods = true stubmethods = true,
} },
} },
} },
} }
+4 -4
View File
@@ -16,8 +16,8 @@
return { return {
cmd = { cmd = {
'java', '-jar', "java", "-jar",
'/usr/share/java/groovy-language-server/groovy-language-server-all.jar' "/usr/share/java/groovy-language-server/groovy-language-server-all.jar",
}, },
single_file_support = true single_file_support = true,
} }
+23 -23
View File
@@ -15,7 +15,7 @@
]] ]]
return { return {
cmd = { 'jedi-language-server' }, cmd = { "jedi-language-server", },
single_file_support = true, single_file_support = true,
-- For more info see https://github.com/pappasam/jedi-language-server#configurationSources -- For more info see https://github.com/pappasam/jedi-language-server#configurationSources
-- and https://github.com/pappasam/coc-jedi#configuration (good descriptions) -- and https://github.com/pappasam/coc-jedi#configuration (good descriptions)
@@ -41,7 +41,7 @@ return {
-- That said, there are situations where IDE developers, -- That said, there are situations where IDE developers,
-- or some programmers in some code bases, may want to filter some completions by name. -- or some programmers in some code bases, may want to filter some completions by name.
-- This flexible interface is provided to accommodate these advanced use cases. -- This flexible interface is provided to accommodate these advanced use cases.
ignorePatterns = {} ignorePatterns = {},
}, },
-- Built-in diagnostics seem to be very basic, -- Built-in diagnostics seem to be very basic,
-- to the point where you are wondering if it's even active. -- to the point where you are wondering if it's even active.
@@ -63,7 +63,7 @@ return {
-- When diagnostics are enabled, run on document save (to disk) -- When diagnostics are enabled, run on document save (to disk)
-- type: boolean -- type: boolean
-- default: true -- default: true
didSave = true didSave = true,
}, },
hover = { hover = {
-- Enable (or disable) all hover text. -- Enable (or disable) all hover text.
@@ -87,17 +87,17 @@ return {
-- type: string[] -- type: string[]
-- default: [] -- default: []
disable = { disable = {
class = { all = false, names = {}, fullNames = {} }, class = { all = false, names = {}, fullNames = {}, },
-- Need to escape lua keyword -- Need to escape lua keyword
['function'] = { all = false, names = {}, fullNames = {} }, ["function"] = { all = false, names = {}, fullNames = {}, },
instance = { all = false, names = {}, fullNames = {} }, instance = { all = false, names = {}, fullNames = {}, },
keyword = { all = false, names = {}, fullNames = {} }, keyword = { all = false, names = {}, fullNames = {}, },
module = { all = false, names = {}, fullNames = {} }, module = { all = false, names = {}, fullNames = {}, },
param = { all = false, names = {}, fullNames = {} }, param = { all = false, names = {}, fullNames = {}, },
path = { all = false, names = {}, fullNames = {} }, path = { all = false, names = {}, fullNames = {}, },
property = { all = false, names = {}, fullNames = {} }, property = { all = false, names = {}, fullNames = {}, },
statement = { all = false, names = {}, fullNames = {} } statement = { all = false, names = {}, fullNames = {}, },
} },
}, },
jediSettings = { jediSettings = {
-- Modules that jedi will directly import without analyzing. -- Modules that jedi will directly import without analyzing.
@@ -117,7 +117,7 @@ return {
-- Print jedi debugging messages to stderr. -- Print jedi debugging messages to stderr.
-- type: boolean -- type: boolean
-- default: false -- default: false
debug = false debug = false,
}, },
-- The preferred MarkupKind for all jedi-language-server messages that take MarkupContent. -- The preferred MarkupKind for all jedi-language-server messages that take MarkupContent.
-- type: string -- type: string
@@ -154,18 +154,18 @@ return {
-- If you manually set this option, it overrides the default. -- If you manually set this option, it overrides the default.
-- Setting it to an empty array will result in no ignored folders. -- Setting it to an empty array will result in no ignored folders.
ignoreFolders = { ignoreFolders = {
'.nox', '.tox', '.venv', '__pycache__', 'venv', ".nox", ".tox", ".venv", "__pycache__", "venv",
'artifacts', 'config', '.vscode', '.pytest_cache', "artifacts", "config", ".vscode", ".pytest_cache",
'build', 'scripts', 'incoax_tests.egg-info', "build", "scripts", "incoax_tests.egg-info",
'node_modules' "node_modules",
}, },
-- Maximum number of symbols returned by a call to workspace/symbols. -- Maximum number of symbols returned by a call to workspace/symbols.
-- type: number -- type: number
-- default: 20 -- default: 20
-- A value less than or equal to zero removes the maximum -- A value less than or equal to zero removes the maximum
-- and allows jedi-language-server to return all workplace symbols found by jedi. -- and allows jedi-language-server to return all workplace symbols found by jedi.
maxSymbols = 20 maxSymbols = 20,
} },
} },
} },
} }
+9 -9
View File
@@ -15,16 +15,16 @@
]] ]]
return { return {
cmd = { 'lemminx' }, cmd = { "lemminx", },
single_file_support = true, single_file_support = true,
init_options = { init_options = {
settings = { settings = {
xml = { xml = {
trace = { server = 'verbose' }, trace = { server = "verbose", },
catalogs = {}, catalogs = {},
logs = { logs = {
client = false, client = false,
file = '/home/oscar/lsp4xml.log' file = "/home/oscar/lsp4xml.log",
}, },
format = { format = {
splitAttributes = true, splitAttributes = true,
@@ -32,9 +32,9 @@ return {
joinContentLines = true, joinContentLines = true,
joinCommentLines = false, joinCommentLines = false,
spaceBeforeEmptyCloseLine = false, spaceBeforeEmptyCloseLine = false,
enabled = true enabled = true,
} },
} },
} },
} },
} }
+13 -13
View File
@@ -14,34 +14,34 @@
limitations under the License. limitations under the License.
]] ]]
local runtime_path = vim.split(package.path, ';') local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, 'lua/?.lua') table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, 'lua/?/init.lua') table.insert(runtime_path, "lua/?/init.lua")
-- spec: https://luals.github.io/wiki/settings/ -- spec: https://luals.github.io/wiki/settings/
return { return {
cmd = { 'lua-language-server' }, cmd = { "lua-language-server", },
single_file_support = true, single_file_support = true,
settings = { settings = {
Lua = { Lua = {
runtime = { runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = 'LuaJIT', version = "LuaJIT",
-- Setup your lua path -- Setup your lua path
path = runtime_path path = runtime_path,
}, },
diagnostics = { diagnostics = {
-- Get the language server to recognize the `vim` global -- Get the language server to recognize the `vim` global
globals = { 'vim' } globals = { "vim", },
}, },
workspace = { workspace = {
-- Make the server aware of Neovim runtime files -- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file('', true), library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false checkThirdParty = false,
}, },
-- Do not send telemetry data containing a randomized but unique identifier -- Do not send telemetry data containing a randomized but unique identifier
telemetry = { enable = false } telemetry = { enable = false, },
} },
} },
} }
+18 -18
View File
@@ -15,7 +15,7 @@
]] ]]
return { return {
cmd = { 'pylsp' }, cmd = { "pylsp", },
single_file_support = true, single_file_support = true,
-- Reference: https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md -- Reference: https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
settings = { settings = {
@@ -23,11 +23,11 @@ return {
-- configurationSources = { "flake8", "jedi_completion", "jedi_definition", "jedi_hover", "jedi_references", "jedi_signature_help", "jedi_symbols" }, -- configurationSources = { "flake8", "jedi_completion", "jedi_definition", "jedi_hover", "jedi_references", "jedi_signature_help", "jedi_symbols" },
plugins = { plugins = {
flake8 = { flake8 = {
config = 'tox.ini', config = "tox.ini",
enabled = true enabled = true,
-- executable = "flake8" -- executable = "flake8"
}, },
pyls_isort = { enabled = true }, pyls_isort = { enabled = true, },
jedi_completion = { jedi_completion = {
enabled = true, enabled = true,
include_params = false, include_params = false,
@@ -36,26 +36,26 @@ return {
eager = true, eager = true,
resolve_at_most = 25, resolve_at_most = 25,
cache_for = { cache_for = {
'pandas', "pandas",
'numpy', "numpy",
'tensorflow', "tensorflow",
'matplotlib' "matplotlib",
} },
}, },
jedi_definition = { jedi_definition = {
enabled = true, enabled = true,
follow_imports = true, follow_imports = true,
follow_builtin_imports = true follow_builtin_imports = true,
}, },
jedi_hover = { enabled = true }, jedi_hover = { enabled = true, },
jedi_references = { enabled = true }, jedi_references = { enabled = true, },
jedi_signature_help = { enabled = true }, jedi_signature_help = { enabled = true, },
jedi_symbols = { jedi_symbols = {
enabled = true, enabled = true,
all_scopes = true, all_scopes = true,
include_import_symbols = true include_import_symbols = true,
} },
} },
} },
} },
} }
+8 -8
View File
@@ -15,7 +15,7 @@
]] ]]
return { return {
cmd = { 'pyright-langserver', '--stdio' }, cmd = { "pyright-langserver", "--stdio", },
single_file_support = true, single_file_support = true,
-- see https://github.com/microsoft/pyright/blob/main/docs/configuration.md -- see https://github.com/microsoft/pyright/blob/main/docs/configuration.md
-- and https://github.com/fannheyward/coc-pyright -- and https://github.com/fannheyward/coc-pyright
@@ -26,14 +26,14 @@ return {
analysis = { analysis = {
autoImportCompletions = true, autoImportCompletions = true,
autoSearchPaths = true, autoSearchPaths = true,
diagnosticMode = 'workspace', diagnosticMode = "workspace",
stubPath = 'typings', stubPath = "typings",
typeschedPaths = {}, typeschedPaths = {},
diagnosticSeverityOverrides = {}, diagnosticSeverityOverrides = {},
typeCheckingMode = 'off', typeCheckingMode = "off",
useLibraryCodeForTypes = true useLibraryCodeForTypes = true,
}, },
completion = { importSupport = true, snippetSupport = true } completion = { importSupport = true, snippetSupport = true, },
} },
} },
} }
+8 -8
View File
@@ -15,24 +15,24 @@
]] ]]
return { return {
cmd = { 'rust-analyzer' }, cmd = { "rust-analyzer", },
settings = { settings = {
-- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc -- https://github.com/rust-lang/rust-analyzer/blob/master/docs/user/generated_config.adoc
['rust-analyzer'] = { ["rust-analyzer"] = {
cargo = { cargo = {
-- Extra environment variables that will be set when running cargo, rustc -- Extra environment variables that will be set when running cargo, rustc
-- or other commands within the workspace. Useful for setting RUSTFLAGS. -- or other commands within the workspace. Useful for setting RUSTFLAGS.
extraEnv = { extraEnv = {
OPENSSL_INCLUDE_DIR = '/usr/include/openssl-1.0/', OPENSSL_INCLUDE_DIR = "/usr/include/openssl-1.0/",
OPENSSL_LIB_DIR = '/usr/lib/openssl-1.0/' OPENSSL_LIB_DIR = "/usr/lib/openssl-1.0/",
} },
} },
--[[ inlayHints = { --[[ inlayHints = {
closingBraceHints = { closingBraceHints = {
-- Whether to show inlay hints after a closing `}` to indicate what item it belongs to. -- Whether to show inlay hints after a closing `}` to indicate what item it belongs to.
enable = false enable = false
}, },
} ]] } ]]
} },
} },
} }
+85 -85
View File
@@ -21,7 +21,7 @@ P._language_servers = nil
P.capabilities = {} P.capabilities = {}
P.spec = require('lsp.spec') P.spec = require("lsp.spec")
function P._setup_diagnostic() function P._setup_diagnostic()
vim.diagnostic.config({ vim.diagnostic.config({
@@ -35,44 +35,44 @@ function P._setup_diagnostic()
-- }, -- },
float = { float = {
show_header = false, show_header = false,
source = 'if_many', source = "if_many",
border = 'rounded', border = "rounded",
focusable = false, focusable = false,
format = function(diagnostic) format = function (diagnostic)
return string.format('%s', diagnostic.message) return string.format("%s", diagnostic.message)
end end,
}, },
update_in_insert = false, -- default to false update_in_insert = false, -- default to false
severity_sort = true -- default to false severity_sort = true, -- default to false
}) })
-- Change diagnostic icons -- Change diagnostic icons
vim.fn.sign_define('DiagnosticSignError', { vim.fn.sign_define("DiagnosticSignError", {
text = 'E', text = "E",
texthl = 'DiagnosticSignError', texthl = "DiagnosticSignError",
-- culhl = 'DiagnosticSignError', -- culhl = 'DiagnosticSignError',
numhl = 'DiagnosticSignError' numhl = "DiagnosticSignError",
-- linehl = 'LspDiagnosticsUnderlineError' -- linehl = 'LspDiagnosticsUnderlineError'
}) })
vim.fn.sign_define('DiagnosticSignWarn', { vim.fn.sign_define("DiagnosticSignWarn", {
text = 'W', text = "W",
texthl = 'DiagnosticSignWarn', texthl = "DiagnosticSignWarn",
-- culhl = 'DiagnosticSignWarn', -- culhl = 'DiagnosticSignWarn',
numhl = 'DiagnosticSignWarn' numhl = "DiagnosticSignWarn",
-- linehl = 'LspDiagnosticsUnderlineWarning' -- linehl = 'LspDiagnosticsUnderlineWarning'
}) })
vim.fn.sign_define('DiagnosticSignHint', { vim.fn.sign_define("DiagnosticSignHint", {
text = 'H', text = "H",
texthl = 'DiagnosticSignHint', texthl = "DiagnosticSignHint",
-- culhl = 'DiagnosticSignHint', -- culhl = 'DiagnosticSignHint',
numhl = 'DiagnosticSignHint' numhl = "DiagnosticSignHint",
-- linehl = 'LspDiagnosticsUnderlineHint' -- linehl = 'LspDiagnosticsUnderlineHint'
}) })
vim.fn.sign_define('DiagnosticSignInfo', { vim.fn.sign_define("DiagnosticSignInfo", {
text = 'i', text = "i",
texthl = 'DiagnosticSignInfo', texthl = "DiagnosticSignInfo",
-- culhl = 'DiagnosticSignInfo', -- culhl = 'DiagnosticSignInfo',
numhl = 'DiagnosticSignInfo' numhl = "DiagnosticSignInfo",
-- linehl = 'LspDiagnosticsUnderlineInfo' -- linehl = 'LspDiagnosticsUnderlineInfo'
}) })
@@ -85,9 +85,9 @@ function P.on_attach(client, bufnr)
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
-- Disabled in favor of nvim-cmp -- Disabled in favor of nvim-cmp
-- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
require('lsp_signature').on_attach({ require("lsp_signature").on_attach({
debug = false, -- set to true to enable debug logging debug = false, -- set to true to enable debug logging
log_path = vim.fn.stdpath('cache') .. '/lsp_signature.log', -- log dir when debug is on log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
-- default is ~/.cache/nvim/lsp_signature.log -- default is ~/.cache/nvim/lsp_signature.log
verbose = false, -- show debug line number verbose = false, -- show debug line number
@@ -115,11 +115,11 @@ function P.on_attach(client, bufnr)
close_timeout = nil, -- close floating window after ms when laster parameter is entered close_timeout = nil, -- close floating window after ms when laster parameter is entered
fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
hint_enable = false, -- virtual hint enable hint_enable = false, -- virtual hint enable
hint_prefix = '🐼 ', -- Panda for parameter, NOTE: for the terminal not support emoji, might crash hint_prefix = "🐼 ", -- Panda for parameter, NOTE: for the terminal not support emoji, might crash
hint_scheme = 'String', hint_scheme = "String",
hi_parameter = 'IncSearch', -- default 'LspSignatureActiveParameter', -- how your parameter will be highlight hi_parameter = "IncSearch", -- default 'LspSignatureActiveParameter', -- how your parameter will be highlight
handler_opts = { handler_opts = {
border = 'none' -- double, rounded, single, shadow, none border = "none", -- double, rounded, single, shadow, none
}, },
always_trigger = true, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58 always_trigger = true, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
@@ -128,80 +128,80 @@ function P.on_attach(client, bufnr)
extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
padding = '', -- character to pad on left and right of signature can be ' ', or '|' etc padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
transparency = nil, -- disabled by default, allow floating win transparent value 1~100 transparency = nil, -- disabled by default, allow floating win transparent value 1~100
shadow_blend = 36, -- if you using shadow as border use this set the opacity shadow_blend = 36, -- if you using shadow as border use this set the opacity
shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
toggle_key = '<C-e>', -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>' toggle_key = "<C-e>", -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
move_cursor_key = '<C-s>' -- imap, use nvim_set_current_win to move cursor between current win and floating move_cursor_key = "<C-s>", -- imap, use nvim_set_current_win to move cursor between current win and floating
}, bufnr) }, bufnr)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true, }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'L', vim.api.nvim_buf_set_keymap(bufnr, "n", "L",
'<cmd>lua vim.diagnostic.open_float()<CR>', opts) "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '[d', vim.api.nvim_buf_set_keymap(bufnr, "n", "[d",
'<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) "<cmd>lua vim.diagnostic.goto_prev()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', ']d', vim.api.nvim_buf_set_keymap(bufnr, "n", "]d",
'<cmd>lua vim.diagnostic.goto_next()<CR>', opts) "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ll', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ll",
'<cmd>lua vim.diagnostic.setloclist()<CR>', opts) "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', vim.api.nvim_buf_set_keymap(bufnr, "n", "gD",
'<cmd>lua vim.lsp.buf.declaration()<CR>', opts) "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', vim.api.nvim_buf_set_keymap(bufnr, "n", "gd",
'<cmd>lua vim.lsp.buf.definition()<CR>', opts) "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', vim.api.nvim_buf_set_keymap(bufnr, "n", "K",
'<cmd>lua vim.lsp.buf.hover()<CR>', opts) "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', vim.api.nvim_buf_set_keymap(bufnr, "n", "gi",
'<cmd>lua vim.lsp.buf.implementation()<CR>', "<cmd>lua vim.lsp.buf.implementation()<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>s', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>s",
'<cmd>lua vim.lsp.buf.signature_help()<CR>', "<cmd>lua vim.lsp.buf.signature_help()<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wa', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>wa",
'<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wr', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>wr",
'<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>wl', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>wl",
'<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gt', vim.api.nvim_buf_set_keymap(bufnr, "n", "gt",
'<cmd>lua vim.lsp.buf.type_definition()<CR>', "<cmd>lua vim.lsp.buf.type_definition()<CR>",
opts) opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn",
'<cmd>lua vim.lsp.buf.rename()<CR>', opts) "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca",
'<cmd>lua vim.lsp.buf.code_action()<CR>', opts) "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', vim.api.nvim_buf_set_keymap(bufnr, "n", "gr",
'<cmd>lua vim.lsp.buf.references()<CR>', opts) "<cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>lf', vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>lf",
'<cmd>lua vim.lsp.buf.format({async = true})<CR>', "<cmd>lua vim.lsp.buf.format({async = true})<CR>",
opts) opts)
-- if client.server_capabilities.document_range_formatting then -- if client.server_capabilities.document_range_formatting then
vim.api.nvim_buf_set_keymap(bufnr, 'v', '<leader>lf', vim.api.nvim_buf_set_keymap(bufnr, "v", "<leader>lf",
'<cmd>lua vim.lsp.buf.format({async = true})<CR>', "<cmd>lua vim.lsp.buf.format({async = true})<CR>",
opts) opts)
-- end -- end
-- The below command will highlight the current variable and its usages in the buffer. -- The below command will highlight the current variable and its usages in the buffer.
if client.server_capabilities.document_highlight then if client.server_capabilities.document_highlight then
vim.fn.execute('hi! link LspReferenceRead Visual') vim.fn.execute("hi! link LspReferenceRead Visual")
vim.fn.execute('hi! link LspReferenceText Visual') vim.fn.execute("hi! link LspReferenceText Visual")
vim.fn.execute('hi! link LspReferenceWrite Visual') vim.fn.execute("hi! link LspReferenceWrite Visual")
vim.api.nvim_create_augroup('lsp_document_highlight', { clear = true }) vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true, })
vim.api.nvim_create_autocmd('CursorHold', { vim.api.nvim_create_autocmd("CursorHold", {
buffer = bufnr, buffer = bufnr,
callback = vim.lsp.buf.document_highlight callback = vim.lsp.buf.document_highlight,
}) })
vim.api.nvim_create_autocmd('CursorMoved', { vim.api.nvim_create_autocmd("CursorMoved", {
buffer = bufnr, buffer = bufnr,
callback = vim.lsp.buf.clear_references callback = vim.lsp.buf.clear_references,
}) })
end end
-- Auto show current line diagnostics after 300 ms -- Auto show current line diagnostics after 300 ms
@@ -223,11 +223,11 @@ function P.reload_server_buf(self, name)
end end
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(bufnr) then if vim.api.nvim_buf_is_loaded(bufnr) then
local buf_ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr }) local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = bufnr, })
if ft_map[buf_ft] then if ft_map[buf_ft] then
vim.api.nvim_buf_call( vim.api.nvim_buf_call(
bufnr, bufnr,
function() vim.cmd('e') end function () vim.cmd("e") end
) )
end end
end end
@@ -263,9 +263,9 @@ function P.language_servers(self)
end end
function P.setup_server(self, server) function P.setup_server(self, server)
local lspconfig = require('lspconfig') local lspconfig = require("lspconfig")
local server_spec = self.spec[server] local server_spec = self.spec[server]
local cfg = require('lsp.config.' .. server) local cfg = require("lsp.config." .. server)
cfg.filetypes = server_spec.filetypes cfg.filetypes = server_spec.filetypes
cfg.root_dir = lspconfig.util.find_git_ancestor cfg.root_dir = lspconfig.util.find_git_ancestor
cfg.capabilities = self.capabilities cfg.capabilities = self.capabilities
@@ -275,12 +275,12 @@ end
function P.setup(self) function P.setup(self)
self._setup_diagnostic() self._setup_diagnostic()
P.capabilities = require('cmp_nvim_lsp').default_capabilities() P.capabilities = require("cmp_nvim_lsp").default_capabilities()
require("mason-lspconfig").setup_handlers({ require("mason-lspconfig").setup_handlers({
function(name) function (name)
self:setup_server(name) self:setup_server(name)
self:reload_server_buf(name) self:reload_server_buf(name)
end end,
}) })
end end
+33 -33
View File
@@ -17,71 +17,71 @@
return { return {
clangd = { clangd = {
filetypes = { filetypes = {
'c', "c",
'cpp', "cpp",
'objc', "objc",
'objcpp', "objcpp",
'cuda', "cuda",
'proto', "proto",
} },
}, },
cmake = { cmake = {
filetypes = { filetypes = {
'cmake' "cmake",
} },
}, },
diagnosticls = { diagnosticls = {
filetypes = { filetypes = {
'python', "python",
'lua', "lua",
'sh', "sh",
} },
}, },
lua_ls = { lua_ls = {
filetypes = { filetypes = {
'lua' "lua",
} },
}, },
lemminx = { lemminx = {
filetypes = { filetypes = {
'xml', "xml",
'xsd', "xsd",
'xsl', "xsl",
'xslt', "xslt",
'svg', "svg",
} },
}, },
bashls = { bashls = {
filetypes = { filetypes = {
'sh' "sh",
} },
}, },
groovyls = { groovyls = {
filetypes = { filetypes = {
'groovy' "groovy",
} },
}, },
rust_analyzer = { rust_analyzer = {
filetypes = { filetypes = {
'rust' "rust",
} },
}, },
gopls = { gopls = {
filetypes = { filetypes = {
"go", "go",
"gomod" "gomod",
} },
}, },
golangci_lint_ls = { golangci_lint_ls = {
filetypes = { filetypes = {
"go", "go",
"gomod" "gomod",
} },
}, },
jedi_language_server = { jedi_language_server = {
filetypes = { filetypes = {
'python' "python",
} },
}, },
-- pyright = { 'python' }, -- pyright = { 'python' },
-- pylsp = { 'python' }, -- pylsp = { 'python' },
+73 -73
View File
@@ -18,43 +18,43 @@ vim.loader.enable()
local plugins = { local plugins = {
{ {
'Mofiqul/vscode.nvim', "Mofiqul/vscode.nvim",
priority = 1000, priority = 1000,
lazy = false, lazy = false,
config = function() require('config.vscode') end config = function () require("config.vscode") end,
}, },
{ {
'rafamadriz/friendly-snippets', "rafamadriz/friendly-snippets",
}, },
{ {
'L3MON4D3/LuaSnip', "L3MON4D3/LuaSnip",
config = function() require('config.luasnip') end, config = function () require("config.luasnip") end,
-- dependencies = { 'rafamadriz/friendly-snippets' }, -- dependencies = { 'rafamadriz/friendly-snippets' },
-- comment out on windows and install jsregexp manually -- comment out on windows and install jsregexp manually
build = "make install_jsregexp", build = "make install_jsregexp",
version = "2.*", version = "2.*",
}, },
{ {
'windwp/nvim-autopairs', "windwp/nvim-autopairs",
config = function() require('config.nvim-autopairs') end config = function () require("config.nvim-autopairs") end,
}, },
{ {
'saadparwaiz1/cmp_luasnip', "saadparwaiz1/cmp_luasnip",
}, },
{ {
'hrsh7th/cmp-buffer', "hrsh7th/cmp-buffer",
}, },
{ {
'hrsh7th/cmp-path', "hrsh7th/cmp-path",
}, },
{ {
'hrsh7th/cmp-cmdline', "hrsh7th/cmp-cmdline",
}, },
{ {
'onsails/lspkind-nvim', "onsails/lspkind-nvim",
}, },
{ {
'hrsh7th/nvim-cmp', "hrsh7th/nvim-cmp",
-- dependencies = { -- dependencies = {
-- 'L3MON4D3/LuaSnip', -- 'L3MON4D3/LuaSnip',
-- 'windwp/nvim-autopairs', -- 'windwp/nvim-autopairs',
@@ -64,33 +64,33 @@ local plugins = {
-- 'hrsh7th/cmp-cmdline', -- 'hrsh7th/cmp-cmdline',
-- 'onsails/lspkind-nvim', -- 'onsails/lspkind-nvim',
-- }, -- },
config = function() require('config.nvim-cmp') end config = function () require("config.nvim-cmp") end,
}, },
{ {
'hrsh7th/cmp-nvim-lsp', "hrsh7th/cmp-nvim-lsp",
-- dependencies = { -- dependencies = {
-- 'hrsh7th/nvim-cmp' -- 'hrsh7th/nvim-cmp'
-- }, -- },
}, },
{ {
"williamboman/mason.nvim", "williamboman/mason.nvim",
config = function() require('config.mason') end config = function () require("config.mason") end,
}, },
{ {
'williamboman/mason-lspconfig.nvim', "williamboman/mason-lspconfig.nvim",
config = function() require('config.mason-lspconfig') end, config = function () require("config.mason-lspconfig") end,
-- dependencies = { 'williamboman/mason.nvim' }, -- dependencies = { 'williamboman/mason.nvim' },
}, },
{ {
'ray-x/lsp_signature.nvim', "ray-x/lsp_signature.nvim",
event = "VeryLazy", event = "VeryLazy",
config = function() require('config.lsp_signature') end config = function () require("config.lsp_signature") end,
}, },
{ {
'neovim/nvim-lspconfig', "neovim/nvim-lspconfig",
config = function() require('lsp'):setup() end, config = function () require("lsp"):setup() end,
lazy = true, lazy = true,
ft = require('lsp'):filetypes(), ft = require("lsp"):filetypes(),
-- dependencies = { -- dependencies = {
-- 'williamboman/mason-lspconfig.nvim', -- 'williamboman/mason-lspconfig.nvim',
-- 'ray-x/lsp_signature.nvim', -- 'ray-x/lsp_signature.nvim',
@@ -98,110 +98,110 @@ local plugins = {
-- }, -- },
}, },
{ {
'nvim-treesitter/nvim-treesitter', "nvim-treesitter/nvim-treesitter",
config = function() require('config.nvim-treesitter') end, config = function () require("config.nvim-treesitter") end,
lazy = true, lazy = true,
event = 'VimEnter', event = "VimEnter",
build = ':TSUpdate' build = ":TSUpdate",
}, },
{ {
'mfussenegger/nvim-dap', "mfussenegger/nvim-dap",
config = function() require('config.nvim-dap') end, config = function () require("config.nvim-dap") end,
lazy = true, lazy = true,
ft = require('lsp'):filetypes(), ft = require("lsp"):filetypes(),
}, },
{ {
'rcarriga/nvim-dap-ui', "rcarriga/nvim-dap-ui",
-- dependencies = { 'mfussenegger/nvim-dap' }, -- dependencies = { 'mfussenegger/nvim-dap' },
config = function() require('config.nvim-dap-ui') end config = function () require("config.nvim-dap-ui") end,
}, },
{ {
'kyazdani42/nvim-web-devicons' "kyazdani42/nvim-web-devicons",
}, },
{ {
'tpope/vim-fugitive', "tpope/vim-fugitive",
config = function() require('config.fugitive') end, config = function () require("config.fugitive") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'rbong/vim-flog', "rbong/vim-flog",
-- dependencies = { 'tpope/vim-fugitive' }, -- dependencies = { 'tpope/vim-fugitive' },
config = function() require('config.flog') end config = function () require("config.flog") end,
}, },
{ {
'nvim-lualine/lualine.nvim', "nvim-lualine/lualine.nvim",
-- dependencies = { 'kyazdani42/nvim-web-devicons', 'vim-fugitive' }, -- dependencies = { 'kyazdani42/nvim-web-devicons', 'vim-fugitive' },
config = function() require('config.lualine') end, config = function () require("config.lualine") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'akinsho/bufferline.nvim', "akinsho/bufferline.nvim",
-- dependencies = { 'kyazdani42/nvim-web-devicons' }, -- dependencies = { 'kyazdani42/nvim-web-devicons' },
config = function() require('config.bufferline') end, config = function () require("config.bufferline") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'nvim-lua/plenary.nvim' "nvim-lua/plenary.nvim",
}, },
{ {
'lewis6991/gitsigns.nvim', "lewis6991/gitsigns.nvim",
-- dependencies = { 'nvim-lua/plenary.nvim' }, -- dependencies = { 'nvim-lua/plenary.nvim' },
config = function() require('config.gitsigns') end, config = function () require("config.gitsigns") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'nvim-telescope/telescope.nvim', "nvim-telescope/telescope.nvim",
-- dependencies = { 'nvim-lua/plenary.nvim' }, -- dependencies = { 'nvim-lua/plenary.nvim' },
config = function() require('config.telescope') end, config = function () require("config.telescope") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'numToStr/Comment.nvim', "numToStr/Comment.nvim",
config = function() require('config.comment') end, config = function () require("config.comment") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'Yggdroot/indentLine', "Yggdroot/indentLine",
config = function() require('config.indentLine') end, config = function () require("config.indentLine") end,
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'simeji/winresizer', "simeji/winresizer",
config = function() require('config.winresizer') end, config = function () require("config.winresizer") end,
lazy = true, lazy = true,
keys = { '<C-W>r' } keys = { "<C-W>r", },
}, },
{ {
'sindrets/winshift.nvim', "sindrets/winshift.nvim",
config = function() require('config.winshift') end, config = function () require("config.winshift") end,
lazy = true, lazy = true,
keys = { '<C-W>m' } keys = { "<C-W>m", },
}, },
{ {
'martinda/Jenkinsfile-vim-syntax', "martinda/Jenkinsfile-vim-syntax",
lazy = true, lazy = true,
ft = { 'jenkinsfile', 'Jenkinsfile' } ft = { "jenkinsfile", "Jenkinsfile", },
}, },
{ {
'kyazdani42/nvim-tree.lua', "kyazdani42/nvim-tree.lua",
config = function() require('config.nvim-tree') end config = function () require("config.nvim-tree") end,
}, },
{ {
'dstein64/vim-startuptime', "dstein64/vim-startuptime",
lazy = true, lazy = true,
event = 'VimEnter' event = "VimEnter",
}, },
{ {
'stevearc/aerial.nvim', "stevearc/aerial.nvim",
config = function() require('config.aerial') end config = function () require("config.aerial") end,
} },
} }
local opts = { local opts = {
@@ -210,4 +210,4 @@ local opts = {
-- } -- }
} }
require('lazy').setup(plugins, opts) require("lazy").setup(plugins, opts)
+18 -18
View File
@@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
]] ]]
local utils = require('utils') local utils = require("utils")
M = {} M = {}
@@ -22,40 +22,40 @@ local env_ok = false
local dap = nil local dap = nil
local function check_env() local function check_env()
local debugpy = utils.exec('python -m debugpy --version') local debugpy = utils.exec("python -m debugpy --version")
assert(debugpy.rc == 0, 'Python module debugpy is required') assert(debugpy.rc == 0, "Python module debugpy is required")
local pytest = utils.exec('python -m pytest --version') local pytest = utils.exec("python -m pytest --version")
assert(pytest.rc == 0, 'Python module pytest is required') assert(pytest.rc == 0, "Python module pytest is required")
env_ok = true env_ok = true
end end
local function load_dap() local function load_dap()
local ok, dap = pcall(require, 'dap') local ok, dap = pcall(require, "dap")
assert(ok, 'nvim-dap is required') assert(ok, "nvim-dap is required")
return dap return dap
end end
function M.run(args) function M.run(args)
assert(type(args) == 'table', 'Args not specified or of wrong type') assert(type(args) == "table", "Args not specified or of wrong type")
if not env_ok then if not env_ok then
check_env() check_env()
end end
if not dap then if not dap then
dap = load_dap() dap = load_dap()
dap.adapters.python = { dap.adapters.python = {
type = 'executable'; type = "executable",
command = 'python'; command = "python",
args = { '-m', 'debugpy.adapter' }; args = { "-m", "debugpy.adapter", },
cwd = vim.fn.getcwd(); cwd = vim.fn.getcwd(),
} }
end end
local config = { local config = {
name = 'pytest ' .. table.concat(args, ' '), name = "pytest " .. table.concat(args, " "),
type = 'python', type = "python",
request = 'launch', request = "launch",
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python', -- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
module = 'pytest', module = "pytest",
-- python = 'python'; -- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest'; -- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
args = args, args = args,
@@ -66,8 +66,8 @@ function M.run(args)
dap.run(config) dap.run(config)
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events -- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
-- Also see :h dap-extensions -- Also see :h dap-extensions
dap.listeners.after['event_initialized']['pytest.lua'] = function(session, body) dap.listeners.after["event_initialized"]["pytest.lua"] = function (session, body)
dap.set_exception_breakpoints({ 'userUnhandled' }) dap.set_exception_breakpoints({ "userUnhandled", })
end end
end end
+4 -4
View File
@@ -29,7 +29,7 @@ function M.exec(cmd)
local out = vim.fn.system(cmd) local out = vim.fn.system(cmd)
local rc = vim.v.shell_error local rc = vim.v.shell_error
return { out = out, rc = rc } return { out = out, rc = rc, }
end end
function M.get_color(group, attr) function M.get_color(group, attr)
@@ -39,8 +39,8 @@ end
function M.get_hl(name) function M.get_hl(name)
local ok, hl = pcall(vim.api.nvim_get_hl_by_name, name, true) local ok, hl = pcall(vim.api.nvim_get_hl_by_name, name, true)
if not ok then return end if not ok then return end
for _, key in pairs({ 'foreground', 'background', 'special' }) do for _, key in pairs({ "foreground", "background", "special", }) do
if hl[key] then hl[key] = string.format('#%06x', hl[key]) end if hl[key] then hl[key] = string.format("#%06x", hl[key]) end
end end
return hl return hl
end end
@@ -79,7 +79,7 @@ end
--- @param exes table: Array of exes --- @param exes table: Array of exes
function M.assert_any_available(exes) function M.assert_any_available(exes)
if not M.any_available(exes) then if not M.any_available(exes) then
error('At least one of the following is required:\n' .. table.concat(exes, ', ')) error("At least one of the following is required:\n" .. table.concat(exes, ", "))
end end
end end