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
+10 -10
View File
@@ -17,14 +17,14 @@
require("aerial").setup({
-- Priority list of preferred backends for aerial.
-- This can be a filetype map (see :help aerial-filetype-map)
backends = { "treesitter", "lsp", "markdown" },
backends = { "treesitter", "lsp", "markdown", },
layout = {
-- 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%)
-- 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 },
max_width = { 40, 0.2, },
width = nil,
min_width = 40,
@@ -159,15 +159,15 @@ require("aerial").setup({
-- Call this function when aerial attaches to a buffer.
-- Useful for setting keymaps. Takes a single `bufnr` argument.
on_attach = function(bufnr)
on_attach = function (bufnr)
-- 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 '}'
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>AerialPrev<CR>", {})
vim.api.nvim_buf_set_keymap(bufnr, "n", "}", "<cmd>AerialNext<CR>", {})
-- 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>AerialNextUp<CR>', {})
vim.api.nvim_buf_set_keymap(bufnr, "n", "[[", "<cmd>AerialPrevUp<CR>", {})
vim.api.nvim_buf_set_keymap(bufnr, "n", "]]", "<cmd>AerialNextUp<CR>", {})
end,
-- 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"
max_height = 0.9,
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.
-- Change values here to customize the layout
return conf
+60 -60
View File
@@ -14,7 +14,7 @@
limitations under the License.
]]
local utils = require 'utils'
local utils = require "utils"
local hl_CustomHeader
local head_cache
@@ -24,13 +24,13 @@ local head_cache
--- @param no_ellipsis boolean whether to disable adding '...' at end after truncation
--- return function that can format the component accordingly
local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis)
return function(str)
return function (str)
local win_width = vim.fn.winwidth(0)
if hide_width and win_width < hide_width then
return ''
return ""
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 '...')
return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...")
end
return str
end
@@ -40,12 +40,12 @@ end
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly
local function l_trunc(trunc_len, no_ellipsis)
return function(str)
return function (str)
if #str > trunc_len then
if no_ellipsis then
return str:sub(#str - trunc_len)
else
return '...' .. str:sub(#str - trunc_len + 3)
return "..." .. str:sub(#str - trunc_len + 3)
end
else
return str
@@ -57,7 +57,7 @@ end
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly
local function r_trunc(trunc_len, no_ellipsis)
return function(str)
return function (str)
if #str > trunc_len then
if no_ellipsis then
return str:sub(1, trunc_len)
@@ -65,7 +65,7 @@ local function r_trunc(trunc_len, no_ellipsis)
return str
else
return str:sub(1, trunc_len - 3) ..
(no_ellipsis and '' or '...')
(no_ellipsis and "" or "...")
end
end
return str
@@ -73,7 +73,7 @@ local function r_trunc(trunc_len, no_ellipsis)
end
local function short_path(len)
return function(str)
return function (str)
if #str > len then return vim.fn.pathshorten(str, 1) end
return str
end
@@ -81,69 +81,69 @@ end
local function header()
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
hl_CustomHeader = 'gui=bold guifg=' .. header_hl.foreground ..
' guibg=' .. header_hl.background
vim.api.nvim_command('hi CustomHeader ' .. hl_CustomHeader)
hl_CustomHeader = "gui=bold guifg=" .. header_hl.foreground ..
" guibg=" .. header_hl.background
vim.api.nvim_command("hi CustomHeader " .. hl_CustomHeader)
end
end
-- local header = short_path(40)(vim.fn.getcwd())
-- NOTE: Decided not to use this. Probably doesn't work.
local gitdir = vim.fn.FugitiveExtractGitDir(vim.fn.getcwd())
local text = ''
if gitdir == '' then
text = vim.fn.fnamemodify(vim.fn.getcwd(), ':~')
local text = ""
if gitdir == "" then
text = vim.fn.fnamemodify(vim.fn.getcwd(), ":~")
else
text = vim.fn.fnamemodify(gitdir, ':~:h')
text = vim.fn.fnamemodify(gitdir, ":~:h")
-- text = vim.fn.fnamemodify(vim.fn.FugitiveWorkTree(), ':~')
-- local branch = r_trunc(15, false)(vim.fn.FugitiveHead())
local head = vim.fn.FugitiveHead(8, gitdir)
if head == '' then
if head == "" then
if head_cache[gitdir] ~= nil then
head = head_cache[gitdir]
else
local f = io.open(gitdir, 'r')
local f = io.open(gitdir, "r")
if f then
io.input(f)
local line = io.read('*l')
local line = io.read("*l")
local head = line:gsub(
'ref: /refs/(heads/|remotes/|tags/)', ''
"ref: /refs/(heads/|remotes/|tags/)", ""
)
head_cache[gitdir] = head
end
end
end
if head ~= '' then text = text .. '' .. head end
if head ~= "" then text = text .. "" .. head end
end
-- return l_trunc(40-2, false)(short_path(40-2)(text))
return l_trunc(40 - 2, false)(text)
end
require('bufferline').setup(
require("bufferline").setup(
{
options = {
mode = 'buffers',
numbers = function(ordinal, id, lower, raise) return '' end,
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"
left_mouse_command = 'buffer %d', -- can be a string | function, see "Mouse actions"
mode = "buffers",
numbers = function (ordinal, id, lower, raise) return "" end,
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"
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"
indicator = {
icon = '', -- this should be omitted if indicator style is not 'icon'
style = 'icon'
icon = "", -- this should be omitted if indicator style is not 'icon'
style = "icon",
},
buffer_close_icon = '',
modified_icon = '',
close_icon = '',
left_trunc_marker = '',
right_trunc_marker = '',
buffer_close_icon = "",
modified_icon = "",
close_icon = "",
left_trunc_marker = "",
right_trunc_marker = "",
--- name_formatter can be used to change the buffer's label in the bufferline.
--- Please note some names can/will break the
--- bufferline so use this at your discretion knowing that it has
--- 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
-- path | str | the full path of the active file
-- 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
truncate_names = true,
tab_size = 18,
diagnostics = 'nvim_lsp',
diagnostics = "nvim_lsp",
diagnostics_update_in_insert = false,
diagnostics_indicator = function(count, _, _, _)
return '(' .. count .. ')'
diagnostics_indicator = function (count, _, _, _)
return "(" .. count .. ")"
end,
-- NOTE: this will be called a lot so don't do any heavy processing here
custom_filter = function(buf, _)
local disabled_ft = { 'NvimTree', 'fugitive' }
custom_filter = function (buf, _)
local disabled_ft = { "NvimTree", "fugitive", }
if utils.has_value(disabled_ft, vim.bo[buf].filetype) then
return false
@@ -172,32 +172,32 @@ require('bufferline').setup(
end,
offsets = {
{
filetype = 'NvimTree',
text = 'File Explorer', -- header,
text_align = 'center',
seperator = true
filetype = "NvimTree",
text = "File Explorer", -- header,
text_align = "center",
seperator = true,
-- padding = 1,
-- highlight = "CustomHeader",
},
{
filetype = 'fugitive',
text = 'Fugitive', -- header,
text_align = 'center',
seperator = true
filetype = "fugitive",
text = "Fugitive", -- header,
text_align = "center",
seperator = true,
-- padding = 1,
-- highlight = "CustomHeader",
},
{
filetype = 'aerial',
text = 'Aerial', -- header,
text_align = 'center',
seperator = true
filetype = "aerial",
text = "Aerial", -- header,
text_align = "center",
seperator = true,
-- padding = 1,
-- highlight = "CustomHeader",
}
},
},
color_icons = true, -- whether or not to add the filetype icon highlights
show_buffer_icons = true, -- disable filetype icons for buffers
color_icons = true, -- whether or not to add the filetype icon highlights
show_buffer_icons = true, -- disable filetype icons for buffers
show_buffer_close_icons = false,
show_buffer_default_icon = true, -- whether or not an unrecognised filetype should show a default icon
show_close_icon = false,
@@ -205,11 +205,11 @@ require('bufferline').setup(
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
-- can also be a table containing 2 custom separators
-- [focused and unfocused]. eg: { '|', '|' }
separator_style = 'thin', -- | "thick" | "thin" | { 'any', 'any' },
separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = true,
always_show_bufferline = true,
hover = { enabled = true, delay = 200, reveal = { 'close' } },
sort_by = 'id'
}
hover = { enabled = true, delay = 200, reveal = { "close", }, },
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
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha
require("catppuccin").setup({
compile_path = vim.fn.stdpath("cache") .. "/catppuccin",
transparent_background = false,
@@ -49,16 +49,16 @@ require("catppuccin").setup({
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
errors = { "italic", },
hints = { "italic", },
warnings = { "italic", },
information = { "italic", },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
errors = { "underline", },
hints = { "underline", },
warnings = { "underline", },
information = { "underline", },
},
},
-- For more plugins integrations please see https://github.com/catppuccin/nvim#integrations
@@ -69,8 +69,8 @@ require("catppuccin").setup({
-- TSConstBuiltin = { fg = colors.peach, style = {} },
-- TSConstant = { fg = colors.sky },
-- TSComment = { fg = colors.surface2, style = { "italic" } }
['@parameter'] = { style = {} }
}
["@parameter"] = { style = {}, },
},
})
vim.cmd("colorscheme catppuccin")
+61 -61
View File
@@ -14,73 +14,73 @@
limitations under the License.
]]
require('Comment').setup(
{
---Add a space b/w comment and the line
---@type boolean|fun():boolean
padding = true,
require("Comment").setup(
{
---Add a space b/w comment and the line
---@type boolean|fun():boolean
padding = true,
---Whether the cursor should stay at its position
---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat
---@type boolean
sticky = true,
---Whether the cursor should stay at its position
---NOTE: This only affects NORMAL mode mappings and doesn't work with dot-repeat
---@type boolean
sticky = true,
---Lines to be ignored while comment/uncomment.
---Could be a regex string or a function that returns a regex string.
---Example: Use '^$' to ignore empty lines
---@type string|fun():string
ignore = '^$',
---Lines to be ignored while comment/uncomment.
---Could be a regex string or a function that returns a regex string.
---Example: Use '^$' to ignore empty lines
---@type string|fun():string
ignore = "^$",
---LHS of toggle mappings in NORMAL + VISUAL mode
---@type table
toggler = {
---Line-comment toggle keymap
line = 'gcc',
---Block-comment toggle keymap
block = 'gbc',
},
---LHS of toggle mappings in NORMAL + VISUAL mode
---@type table
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gbc",
},
---LHS of operator-pending mappings in NORMAL + VISUAL mode
---@type table
opleader = {
---Line-comment keymap
line = 'gc',
---Block-comment keymap
block = 'gb',
},
---LHS of operator-pending mappings in NORMAL + VISUAL mode
---@type table
opleader = {
---Line-comment keymap
line = "gc",
---Block-comment keymap
block = "gb",
},
---LHS of extra mappings
---@type table
extra = {
---Add comment on the line above
above = 'gcO',
---Add comment on the line below
below = 'gco',
---Add comment at the end of line
eol = 'gcA',
},
---LHS of extra mappings
---@type table
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},
---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode
---@type table
mappings = {
---Operator-pending mapping
---Includes `gcc`, `gbc`, `gc[count]{motion}` and `gb[count]{motion}`
---NOTE: These mappings can be changed individually by `opleader` and `toggler` config
basic = true,
---Extra mapping
---Includes `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
extended = false,
},
---Create basic (operator-pending) and extended mappings for NORMAL + VISUAL mode
---@type table
mappings = {
---Operator-pending mapping
---Includes `gcc`, `gbc`, `gc[count]{motion}` and `gb[count]{motion}`
---NOTE: These mappings can be changed individually by `opleader` and `toggler` config
basic = true,
---Extra mapping
---Includes `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping
---Includes `g>`, `g<`, `g>[count]{motion}` and `g<[count]{motion}`
extended = false,
},
---Pre-hook, called before commenting the line
---@type fun(ctx: Ctx):string
pre_hook = nil,
---Pre-hook, called before commenting the line
---@type fun(ctx: Ctx):string
pre_hook = nil,
---Post-hook, called after commenting is done
---@type fun(ctx: Ctx)
post_hook = nil,
}
---Post-hook, called after commenting is done
---@type fun(ctx: Ctx)
post_hook = nil,
}
)
+96 -96
View File
@@ -14,108 +14,108 @@
limitations under the License.
]]
local cb = require'diffview.config'.diffview_callback
local cb = require "diffview.config".diffview_callback
require'diffview'.setup {
diff_binaries = false, -- Show diffs for binaries
enhanced_diff_hl = true, -- See ':h diffview-config-enhanced_diff_hl'
use_icons = true, -- Requires nvim-web-devicons
icons = { -- Only applies when use_icons is true.
folder_closed = "",
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'.
require "diffview".setup {
diff_binaries = false, -- Show diffs for binaries
enhanced_diff_hl = true, -- See ':h diffview-config-enhanced_diff_hl'
use_icons = true, -- Requires nvim-web-devicons
icons = { -- Only applies when use_icons is true.
folder_closed = "",
folder_open = "",
},
},
file_history_panel = {
position = "bottom",
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.
signs = {
fold_closed = "",
fold_open = "",
},
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"),
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'.
},
},
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"),
position = "bottom",
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
},
},
option_panel = {
["<tab>"] = cb("select"),
["q"] = cb("close"),
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 = {
["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.
]]
vim.g.edge_style = 'default'
vim.g.edge_style = "default"
vim.g.edge_disable_italic_comment = 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_menu_selection_background = 'blue'
vim.g.edge_spell_foreground = 'none'
vim.g.edge_menu_selection_background = "blue"
vim.g.edge_spell_foreground = "none"
vim.g.edge_show_eob = 1
vim.g.edge_diagnostic_text_highlight = 0
vim.g.edge_diagnostic_line_highlight = 1
vim.g.edge_diagnostic_virtual_text = 'grey'
vim.g.edge_current_word = 'grey background'
vim.g.edge_diagnostic_virtual_text = "grey"
vim.g.edge_current_word = "grey background"
vim.g.edge_disable_terminal_colors = 0
vim.g.edge_lightline_disable_bold = 0
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.
]]
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")
end
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>gc', ':G commit<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>gc", ":G commit<CR>", { remap = false, })
+1 -1
View File
@@ -14,6 +14,6 @@
limitations under the License.
]]
local gl = require('galaxyline')
local gl = require("galaxyline")
-- maybe some other day
+13 -13
View File
@@ -14,9 +14,9 @@
limitations under the License.
]]
require('github-theme').setup(
require("github-theme").setup(
{
theme_style = 'dimmed',
theme_style = "dimmed",
transparent = false,
hide_end_of_buffer = false,
hide_inactive_statusline = false,
@@ -24,20 +24,20 @@ require('github-theme').setup(
dev = false,
-- styles
comment_style = 'italic',
function_style = 'NONE',
keyword_style = 'NONE',
msg_area_style = 'NONE',
variable_style = 'NONE',
comment_style = "italic",
function_style = "NONE",
keyword_style = "NONE",
msg_area_style = "NONE",
variable_style = "NONE",
-- sidebars
sidebars = {
'qf',
'vista_kind',
'terminal',
'packer',
'aerial',
'NvimTree'
"qf",
"vista_kind",
"terminal",
"packer",
"aerial",
"NvimTree",
},
-- 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.
]]
require('gitsigns').setup(
require("gitsigns").setup(
{
on_attach = function(bufnr)
on_attach = function (bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
@@ -42,20 +42,20 @@ require('gitsigns').setup(
-- }
-- 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-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', '<leader>g?', gs.preview_hunk)
map('n', '<leader>gb', function()
gs.blame_line { full = true }
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>gb", function ()
gs.blame_line { full = true, }
end)
-- map('n', '<leader>gd', gs.diffthis)
end,
signs = {
-- default
-- untracked = { text = '┆' }
untracked = { text = '' }
}
untracked = { text = "", },
},
}
)
+1 -1
View File
@@ -19,6 +19,6 @@ require("indent_blankline").setup({
show_current_context_start = false,
use_treesitter = true,
show_first_indent_level = true,
char = '',
char = "",
-- context_char = '┃',
})
+2 -2
View File
@@ -15,8 +15,8 @@
]]
-- more options at https://www.jetbrains.com/lp/mono/
vim.g.indentLine_char = ''
vim.g.indentLine_char = ""
-- Disable conceal for some syntax plugins
vim.g.vim_json_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.
]]
require('kanagawa').setup({
undercurl = true, -- enable undercurls
commentStyle = { italic = true },
require("kanagawa").setup({
undercurl = true, -- enable undercurls
commentStyle = { italic = true, },
functionStyle = {},
keywordStyle = {},
statementStyle = { bold = true },
statementStyle = { bold = true, },
typeStyle = {},
variablebuiltinStyle = {},
specialReturn = true, -- special highlight for the return keyword
specialException = true, -- special highlight for exception handling keywords
transparent = false, -- do not set background color
dimInactive = true, -- dim inactive window `:h hl-NormalNC`
globalStatus = true, -- adjust window separators highlight for laststatus=3
specialReturn = true, -- special highlight for the return keyword
specialException = true, -- special highlight for exception handling keywords
transparent = false, -- do not set background color
dimInactive = true, -- dim inactive window `:h hl-NormalNC`
globalStatus = true, -- adjust window separators highlight for laststatus=3
colors = {},
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_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_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
--- return function that can format the component accordingly
local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis)
return function(str)
local win_width = vim.fn.winwidth(0)
if hide_width and win_width < hide_width then return ''
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 '...')
return function (str)
local win_width = vim.fn.winwidth(0)
if hide_width and win_width < hide_width then
return ""
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
return str
end
end
--- @param trunc_len number truncates component to trunc_len number of chars
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly
local function l_trunc(trunc_len, no_ellipsis)
return function(str)
if #str > trunc_len then
return (no_ellipsis and '' or '...') .. str:sub(-trunc_len, -1)
return function (str)
if #str > trunc_len then
return (no_ellipsis and "" or "...") .. str:sub(-trunc_len, -1)
end
return str
end
return str
end
end
--- @param trunc_len number truncates component to trunc_len number of chars
--- @param no_ellipsis boolean whether to disable adding '...' at start before truncation
--- return function that can format the component accordingly
local function r_trunc(trunc_len, no_ellipsis)
return function(str)
if #str > trunc_len then
return str:sub(1, trunc_len) .. (no_ellipsis and '' or '...')
return function (str)
if #str > trunc_len then
return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...")
end
return str
end
return str
end
end
local function short_path(len)
return function(str)
return function (str)
if #str > len then
return vim.fn.pathshorten(str, 1)
end
@@ -66,39 +67,39 @@ end
local function header()
local text = short_path(40)(vim.fn.getcwd())
local branch = r_trunc(15, false)(vim.fn.FugitiveHead())
if branch ~= '' then
text = text .. '' .. branch
if branch ~= "" then
text = text .. "" .. branch
end
return text
end
require('lualine').setup ({
require("lualine").setup({
options = {
icons_enabled = true,
-- theme = require('config.nightfox_lualine_custom'),
theme = 'auto',
theme = "auto",
-- theme = "catppuccin",
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = { 'NvimTree', 'fugitive' },
component_separators = { left = "", right = "", },
section_separators = { left = "", right = "", },
disabled_filetypes = { "NvimTree", "fugitive", },
always_divide_middle = true,
globalstatus = true
globalstatus = true,
},
sections = {
lualine_a = { },
lualine_b = { 'mode' },
lualine_c = { { 'filename', path = 1 }, 'diff', {'diagnostics', sources = {'nvim_lsp'}}},
lualine_x = { 'filetype', 'encoding', 'fileformat', 'progress' },
lualine_y = { 'location' },
lualine_z = { }
lualine_a = {},
lualine_b = { "mode", },
lualine_c = { { "filename", path = 1, }, "diff", { "diagnostics", sources = { "nvim_lsp", }, }, },
lualine_x = { "filetype", "encoding", "fileformat", "progress", },
lualine_y = { "location", },
lualine_z = {},
},
inactive_sections = {
lualine_a = { },
lualine_b = { },
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = { },
lualine_z = { }
lualine_a = {},
lualine_b = {},
lualine_c = { "filename", },
lualine_x = { "location", },
lualine_y = {},
lualine_z = {},
},
-- tabline = {
-- lualine_a = { { header } },
@@ -108,6 +109,5 @@ require('lualine').setup ({
-- lualine_y = {},
-- lualine_z = {}
-- },
extensions = { }
extensions = {},
})
+1 -1
View File
@@ -28,4 +28,4 @@
-- local ai = require("luasnip.nodes.absolute_indexer")
-- 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" }
-- This setting has no relation with the `automatic_installation` setting.
---@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.
-- This setting has no relation with the `ensure_installed` setting.
+21 -21
View File
@@ -14,41 +14,41 @@
limitations under the License.
]]
require('material').setup({
require("material").setup({
contrast = {
sidebars = false, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree )
floating_windows = false, -- Enable contrast for floating windows
line_numbers = false, -- Enable contrast background for line numbers
sign_column = false, -- Enable contrast background for the sign column
cursor_line = false, -- Enable darker background for the cursor line
sidebars = false, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree )
floating_windows = false, -- Enable contrast for floating windows
line_numbers = false, -- Enable contrast background for line numbers
sign_column = false, -- Enable contrast background for the sign column
cursor_line = false, -- Enable darker background for the cursor line
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 = {
comments = false, -- Enable italic comments
keywords = false, -- Enable italic keywords
comments = false, -- Enable italic comments
keywords = false, -- Enable italic keywords
functions = false, -- Enable italic functions
strings = false, -- Enable italic strings
variables = false -- Enable italic variables
strings = false, -- Enable italic strings
variables = false, -- Enable italic variables
},
contrast_filetypes = { -- Specify which filetypes get the contrasted (darker) background
"terminal", -- Darker terminal background
"packer", -- Darker packer background
"qf" -- Darker qf list background
"terminal", -- Darker terminal background
"packer", -- Darker packer background
"qf", -- Darker qf list background
},
high_visibility = {
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 = {
borders = false, -- Disable borders between verticaly split windows
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
eob_lines = false -- Hide the end-of-buffer lines
borders = false, -- Disable borders between verticaly split windows
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
eob_lines = false, -- Hide the end-of-buffer lines
},
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)
custom_highlights = {} -- Overwrite highlights with your own
async_loading = true, -- Load parts of the theme asyncronously for faster startup (turned on by default)
custom_highlights = {}, -- Overwrite highlights with your own
})
vim.g.material_style = "deep ocean"
vim.fn.execute("colorscheme material")
+17 -17
View File
@@ -14,16 +14,16 @@
limitations under the License.
]]
require('nightfox').setup({
require("nightfox").setup({
options = {
-- Compiled file's destination location
compile_path = vim.fn.stdpath("cache") .. "/nightfox",
compile_file_suffix = "_compiled", -- Compiled file suffix
transparent = false, -- Disable setting background
terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
dim_inactive = false, -- Non focused panes set to alternative background
styles = { -- Style to be applied to different syntax groups
comments = "NONE", -- Value is any valid attr-list value `:help attr-list`
transparent = false, -- Disable setting background
terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
dim_inactive = false, -- Non focused panes set to alternative background
styles = { -- Style to be applied to different syntax groups
comments = "NONE", -- Value is any valid attr-list value `:help attr-list`
functions = "NONE",
keywords = "NONE",
numbers = "NONE",
@@ -31,16 +31,16 @@ require('nightfox').setup({
types = "NONE",
variables = "NONE",
},
inverse = { -- Inverse highlight for different types
inverse = { -- Inverse highlight for different types
match_paren = false,
visual = false,
search = false,
},
modules = { -- List of various plugins and additional options
modules = { -- List of various plugins and additional options
cmp = true,
diagnostic = {
enable = true,
background = true
background = true,
},
gitsigns = 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
-- 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
Normal = { bg = "palette.bg0", link = "" },
NormalNC = { bg = "palette.bg0", link = "" },
NormalFloat = { bg = "palette.bg1", link = "" },
CursorLine = { bg = "palette.bg1", link = "" },
StatusLine = { bg = "palette.bg1", link = "" },
StatusLineNC = { bg = "palette.bg1", link = "" }
}
}
Normal = { bg = "palette.bg0", link = "", },
NormalNC = { bg = "palette.bg0", link = "", },
NormalFloat = { bg = "palette.bg1", link = "", },
CursorLine = { bg = "palette.bg1", link = "", },
StatusLine = { bg = "palette.bg1", link = "", },
StatusLineNC = { bg = "palette.bg1", link = "", },
},
},
})
vim.cmd("colorscheme nightfox")
+16 -16
View File
@@ -22,26 +22,26 @@ local bg = Color.from_hex(spec.bg1)
local fg = spec.fg2
local function generate_mode(color, amount)
amount = amount or 0.3
local fade = bg:blend(Color.from_hex(color), amount):to_css()
local b = bg:to_css()
local f = fg
amount = amount or 0.3
local fade = bg:blend(Color.from_hex(color), amount):to_css()
local b = bg:to_css()
local f = fg
return {
a = { bg = color, fg = b },
b = { bg = fade, fg = f },
c = { bg = b, fg = f },
}
return {
a = { bg = color, fg = b, },
b = { bg = fade, fg = f, },
c = { bg = b, fg = f, },
}
end
-- stylua: ignore
local nightfox = {
normal = generate_mode(pal.blue.base),
insert = generate_mode(pal.green.base),
command = generate_mode(pal.yellow.base),
visual = generate_mode(pal.magenta.base),
replace = generate_mode(pal.red.base),
inactive = generate_mode(spec.fg3),
local nightfox = {
normal = generate_mode(pal.blue.base),
insert = generate_mode(pal.green.base),
command = generate_mode(pal.yellow.base),
visual = generate_mode(pal.magenta.base),
replace = generate_mode(pal.red.base),
inactive = generate_mode(spec.fg3),
}
return nightfox
+1 -1
View File
@@ -19,4 +19,4 @@ vim.g.nord_borders = false
vim.g.nord_disable_background = false
vim.g.nord_italic = false
require('nord').set()
require("nord").set()
+10 -11
View File
@@ -14,22 +14,21 @@
limitations under the License.
]]
require('nvim-autopairs').setup({
disable_filetype = { "TelescopePrompt" },
disable_in_macro = false, -- disable when recording or executing a macro
require("nvim-autopairs").setup({
disable_filetype = { "TelescopePrompt", },
disable_in_macro = false, -- disable when recording or executing a macro
disable_in_visualblock = false, -- disable when insert after visual block mode
ignored_next_char = [=[[%w%%%'%[%"%.]]=],
enable_moveright = true,
enable_afterquote = true, -- add bracket pairs after quote
enable_check_bracket_line = true, --- check bracket in same line
enable_bracket_in_quote = true, --
enable_abbr = false, -- trigger abbreviation
break_undo = true, -- switch for basic rule break undo sequence
enable_afterquote = true, -- add bracket pairs after quote
enable_check_bracket_line = true, --- check bracket in same line
enable_bracket_in_quote = true, --
enable_abbr = false, -- trigger abbreviation
break_undo = true, -- switch for basic rule break undo sequence
check_ts = false,
map_cr = true,
map_bs = true, -- map the <BS> key
map_c_h = false, -- Map the <C-h> key to delete a pair
map_bs = true, -- map the <BS> key
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
})
-- cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket"
+47 -47
View File
@@ -14,44 +14,44 @@
limitations under the License.
]]
local has_words_before = function()
local has_words_before = function ()
unpack = unpack or table.unpack
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
end
local cmp = require('cmp')
local luasnip = require('luasnip')
local lspkind = require('lspkind')
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
cmp.setup({
enabled = function()
enabled = function ()
-- 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
if vim.api.nvim_get_mode().mode == 'c' then
if vim.api.nvim_get_mode().mode == "c" then
return true
else
return not context.in_treesitter_capture('comment') and
not context.in_syntax_group('Comment')
return not context.in_treesitter_capture("comment") and
not context.in_syntax_group("Comment")
end
end,
completion = { keyword_length = 3 },
completion = { keyword_length = 3, },
snippet = {
expand = function(args)
expand = function (args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
luasnip.lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end
end,
},
formatting = {
format = function(entry, vim_item)
format = function (entry, vim_item)
vim_item = lspkind.cmp_format({
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)
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)
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
-- 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
return vim_item
end
end,
},
experimental = { ghost_text = true },
experimental = { ghost_text = true, },
mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping(
function(fallback)
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping(
function (fallback)
if cmp.visible() then
cmp.confirm(
{
behavior = cmp.ConfirmBehavior.Replace,
select = true
select = true,
}
)
-- vim.api.nvim_feedkeys('(', 'i', true)
else
fallback()
end
end, { 'i', 's' }
end, { "i", "s", }
),
-- ['<Down>'] = cmp.mapping(
-- function(fallback)
@@ -112,8 +112,8 @@ cmp.setup({
-- end
-- end, { 'i', 's' }
-- ),
['<Tab>'] = cmp.mapping(
function(fallback)
["<Tab>"] = cmp.mapping(
function (fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls within expand_or_locally_jumpable()
@@ -125,11 +125,11 @@ cmp.setup({
else
fallback()
end
end, { 'i', 's' }
end, { "i", "s", }
),
['<S-Tab>'] = cmp.mapping(
function(fallback)
["<S-Tab>"] = cmp.mapping(
function (fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
@@ -137,20 +137,20 @@ cmp.setup({
else
fallback()
end
end, { 'i', 's' }
)
end, { "i", "s", }
),
},
sources = {
-- { name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lsp' },
{ name = "path", },
{ name = "nvim_lsp", },
-- { name = 'nvim_lsp_signature_help' },
-- { name = 'nvim_lua' },
-- { name = 'vsnip' }, -- For vsnip users.
{ name = 'luasnip' } -- For luasnip users.
{ name = "luasnip", }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips 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
-- -- gray
@@ -171,26 +171,26 @@ cmp.setup({
-- vim.fn.execute("highlight! CmpItemKindUnit guibg=NONE guifg=#D4D4D4")
cmp.setup.cmdline(
'/',
"/",
{
mapping = cmp.mapping.preset.cmdline(),
sources = { { name = 'buffer' } }
sources = { { name = "buffer", }, },
}
)
cmp.setup.cmdline(
':',
":",
{
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources(
{ { name = 'path' } },
{ { name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } } }
)
{ { name = "path", }, },
{ { 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(
'confirm_done',
"confirm_done",
cmp_autopairs.on_confirm_done()
)
+4 -5
View File
@@ -14,7 +14,7 @@
limitations under the License.
]]
require('nvim_comment').setup({
require("nvim_comment").setup({
-- Linters prefer comment and line to have a space in between markers
marker_padding = true,
-- should comment out empty or whitespace only lines
@@ -26,8 +26,7 @@ require('nvim_comment').setup({
-- Visual/Operator mapping left hand side
-- operator_mapping = "<leader>c",
-- Hook function to call before commenting takes place
hook = nil
hook = nil,
})
vim.keymap.set('n', '<leader>c', ':CommentToggle<CR>')
vim.keymap.set('v', '<leader>c', ":'<, '>CommentToggle<CR>")
vim.keymap.set("n", "<leader>c", ":CommentToggle<CR>")
vim.keymap.set("v", "<leader>c", ":'<, '>CommentToggle<CR>")
+37 -37
View File
@@ -15,43 +15,43 @@
]]
require("dapui").setup({
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"
icons = { expanded = "", collapsed = "", },
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",
},
},
windows = { indent = 1 },
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 = {
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>dl :lua require'dap'.run_last()<CR>")
local utils = require('utils')
local utils = require("utils")
M = {}
@@ -34,14 +34,14 @@ local env_ok = false
local dap = nil
local function check_env()
local debugpy = utils.exec('python -m debugpy --version')
assert(debugpy.rc == 0, 'Python module debugpy is required')
local debugpy = utils.exec("python -m debugpy --version")
assert(debugpy.rc == 0, "Python module debugpy is required")
env_ok = true
end
local function load_dap()
local ok, p = pcall(require, 'dap')
assert(ok, 'nvim-dap is required')
local ok, p = pcall(require, "dap")
assert(ok, "nvim-dap is required")
return p
end
@@ -52,44 +52,44 @@ local function start(config)
if not dap then
dap = load_dap()
dap.adapters.python = {
type = 'executable';
command = 'python';
args = { '-m', 'debugpy.adapter' };
cwd = vim.fn.getcwd();
type = "executable",
command = "python",
args = { "-m", "debugpy.adapter", },
cwd = vim.fn.getcwd(),
}
end
dap.run(config)
-- List of events described at https://microsoft.github.io/debug-adapter-protocol/specification#Events
-- Also see :h dap-extensions
dap.listeners.after['event_initialized']['nvim-dap.lua'] = function()
dap.set_exception_breakpoints({ 'userUnhandled' })
dap.listeners.after["event_initialized"]["nvim-dap.lua"] = function ()
dap.set_exception_breakpoints({ "userUnhandled", })
end
end
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 = {
name = 'Launch file',
type = 'python',
request = 'launch',
program = "${file}";
name = "Launch file",
type = "python",
request = "launch",
program = "${file}",
-- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
console = "integratedTerminal",
args = args
args = args,
}
start(config)
end
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 = {
name = 'pytest ' .. table.concat(args, ' '),
type = 'python',
request = 'launch',
name = "pytest " .. table.concat(args, " "),
type = "python",
request = "launch",
-- pythonPath = vim.fn.getcwd() .. '/.venv/bin/python',
module = 'pytest',
module = "pytest",
-- python = 'python';
-- program = vim.fn.getcwd() .. '/.venv/bin/pytest';
args = args,
+7 -7
View File
@@ -14,7 +14,7 @@
limitations under the License.
]]
local nvim_tree = require('nvim-tree')
local nvim_tree = require("nvim-tree")
nvim_tree.setup({
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,
},
hijack_directories = {
@@ -132,7 +132,7 @@ nvim_tree.setup({
enable = true,
update_root = true,
ignore_list = {
'help'
"help",
},
},
-- ignore_ft_on_setup = {},
@@ -193,8 +193,8 @@ nvim_tree.setup({
enable = true,
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" },
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame", },
buftype = { "nofile", "terminal", "help", },
},
},
},
@@ -226,5 +226,5 @@ nvim_tree.setup({
},
})
local opts = { remap = false, silent = true }
vim.keymap.set('n', "<leader>tt", function() nvim_tree.toggle(false, true) end, opts)
local opts = { remap = false, silent = true, }
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.
]]
require('nvim-treesitter.configs').setup({
require("nvim-treesitter.configs").setup({
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = {
"bash",
@@ -40,21 +40,21 @@ require('nvim-treesitter.configs').setup({
},
indent = {
enable = true
enable = true,
},
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
-- List of parsers to ignore installing
ignore_install = { },
ignore_install = {},
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
disable = { },
disable = {},
-- 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).
+17 -17
View File
@@ -14,36 +14,36 @@
limitations under the License.
]]
require('onedark').setup {
require("onedark").setup {
-- Main options --
style = 'darker', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
transparent = false, -- Show/hide background
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
style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
transparent = false, -- Show/hide background
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
-- toggle theme style ---
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_key = "<leader>ts", -- Default keybinding to toggle
toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light", }, -- List of styles to toggle between
-- Change code style ---
-- Options are italic, bold, underline, none
-- You can configure multiple style with comma seperated, For e.g., keywords = 'italic,bold'
code_style = {
comments = 'italic',
keywords = 'none',
functions = 'none',
strings = 'none',
variables = 'none'
comments = "italic",
keywords = "none",
functions = "none",
strings = "none",
variables = "none",
},
-- Custom Highlights --
colors = {}, -- Override default colors
colors = {}, -- Override default colors
highlights = {}, -- Override highlight groups
-- Plugins Config --
diagnostics = {
darker = true, -- darker colors for diagnostic
undercurl = true, -- use undercurl instead of underline for diagnostics
background = true, -- use background color for virtual text
darker = true, -- darker colors for diagnostic
undercurl = true, -- use undercurl instead of underline for diagnostics
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,
show_guides = true,
auto_preview = true,
position = 'left',
position = "left",
relative_width = true,
width = 25,
auto_close = false,
show_numbers = true,
show_relative_numbers = 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
close = {"<Esc>", "q"},
close = { "<Esc>", "q", },
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
@@ -38,32 +38,32 @@ vim.g.symbols_outline = {
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = {icon = "", hl = "TSURI"},
Module = {icon = "", hl = "TSNamespace"},
Namespace = {icon = "", hl = "TSNamespace"},
Package = {icon = "", hl = "TSNamespace"},
Class = {icon = "𝓒", hl = "TSType"},
Method = {icon = "ƒ", hl = "TSMethod"},
Property = {icon = "", hl = "TSMethod"},
Field = {icon = "", hl = "TSField"},
Constructor = {icon = "", hl = "TSConstructor"},
Enum = {icon = "", hl = "TSType"},
Interface = {icon = "", hl = "TSType"},
Function = {icon = "", hl = "TSFunction"},
Variable = {icon = "", hl = "TSConstant"},
Constant = {icon = "", hl = "TSConstant"},
String = {icon = "𝓐", hl = "TSString"},
Number = {icon = "#", hl = "TSNumber"},
Boolean = {icon = "", hl = "TSBoolean"},
Array = {icon = "", hl = "TSConstant"},
Object = {icon = "⦿", hl = "TSType"},
Key = {icon = "🔐", hl = "TSType"},
Null = {icon = "NULL", hl = "TSType"},
EnumMember = {icon = "", hl = "TSField"},
Struct = {icon = "𝓢", hl = "TSType"},
Event = {icon = "🗲", hl = "TSType"},
Operator = {icon = "+", hl = "TSOperator"},
TypeParameter = {icon = "𝙏", hl = "TSParameter"}
}
File = { icon = "", hl = "TSURI", },
Module = { icon = "", hl = "TSNamespace", },
Namespace = { icon = "", hl = "TSNamespace", },
Package = { icon = "", hl = "TSNamespace", },
Class = { icon = "𝓒", hl = "TSType", },
Method = { icon = "ƒ", hl = "TSMethod", },
Property = { icon = "", hl = "TSMethod", },
Field = { icon = "", hl = "TSField", },
Constructor = { icon = "", hl = "TSConstructor", },
Enum = { icon = "", hl = "TSType", },
Interface = { icon = "", hl = "TSType", },
Function = { icon = "", hl = "TSFunction", },
Variable = { icon = "", hl = "TSConstant", },
Constant = { icon = "", hl = "TSConstant", },
String = { icon = "𝓐", hl = "TSString", },
Number = { icon = "#", hl = "TSNumber", },
Boolean = { icon = "", hl = "TSBoolean", },
Array = { icon = "", hl = "TSConstant", },
Object = { icon = "⦿", hl = "TSType", },
Key = { icon = "🔐", hl = "TSType", },
Null = { icon = "NULL", hl = "TSType", },
EnumMember = { icon = "", hl = "TSField", },
Struct = { icon = "𝓢", hl = "TSType", },
Event = { icon = "🗲", hl = "TSType", },
Operator = { icon = "+", hl = "TSOperator", },
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.
]]
local builtin = require('telescope.builtin')
local builtin = require("telescope.builtin")
vim.keymap.set(
'n', '<leader>ff', function() builtin.find_files({ hidden = true }) end,
{ remap = false }
"n", "<leader>ff", function () builtin.find_files({ hidden = true, }) end,
{ remap = false, }
)
vim.keymap.set(
'n', '<leader>fr', function() builtin.oldfiles({ hidden = true }) end,
{ remap = false }
"n", "<leader>fr", function () builtin.oldfiles({ hidden = true, }) end,
{ remap = false, }
)
vim.keymap.set(
'n', '<leader>fg', function()
"n", "<leader>fg", function ()
builtin.live_grep(
{ additional_args = function(_) return { '--hidden' } end }
{ additional_args = function (_) return { "--hidden", } end, }
)
end, { remap = false }
end, { remap = false, }
)
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')
+1 -1
View File
@@ -18,7 +18,7 @@ vim.g.tokyonight_style = "night"
vim.g.tokyonight_terminal_colors = true
vim.g.tokyonight_italic_comments = 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_float = true
vim.g.tokyonight_lualine_bold = true
+4 -4
View File
@@ -20,8 +20,8 @@
-- vim.g.UltiSnipsExpandTrigger="<Tab>"
-- vim.g.UltiSnipsJumpForwardTrigger="<C-l>"
-- vim.g.UltiSnipsJumpBackwardTrigger="<C-h>"
vim.g.UltiSnipsExpandTrigger = '<Plug>(ultisnips_expand)'
vim.g.UltiSnipsJumpForwardTrigger = '<Plug>(ultisnips_jump_forward)'
vim.g.UltiSnipsJumpBackwardTrigger = '<Plug>(ultisnips_jump_backward)'
vim.g.UltiSnipsListSnippets = '<c-x><c-s>'
vim.g.UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
vim.g.UltiSnipsJumpForwardTrigger = "<Plug>(ultisnips_jump_forward)"
vim.g.UltiSnipsJumpBackwardTrigger = "<Plug>(ultisnips_jump_backward)"
vim.g.UltiSnipsListSnippets = "<c-x><c-s>"
vim.g.UltiSnipsRemoveSelectModeMappings = 0
+3 -4
View File
@@ -14,8 +14,7 @@
limitations under the License.
]]
vim.g.vista_sidebar_position = 'vertical topleft'
vim.g.vista_icon_indent = { "╰─▸ ", "├─▸ " }
vim.g.vista_default_executive = 'nvim_lsp'
vim.g.vista_sidebar_position = "vertical topleft"
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")
-- local c = require('vscode.colors')
require('vscode').setup({
style = 'dark',
require("vscode").setup({
style = "dark",
-- Enable transparent background
transparent = false,
@@ -46,7 +46,7 @@ require('vscode').setup({
-- this supports the same val table as vim.api.nvim_set_hl
-- use colors from this colorscheme by requiring vscode.colors!
-- 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_start_key = ""
local opts = { remap = false, silent = true }
vim.keymap.set('n', "<C-W>r", ":WinResizerStartResize<CR>", opts)
local opts = { remap = false, silent = true, }
vim.keymap.set("n", "<C-W>r", ":WinResizerStartResize<CR>", opts)
+1 -1
View File
@@ -14,4 +14,4 @@
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, })