1
0
Fork 0

.config/nvim: update

main
urosm 2024-05-05 17:34:33 +02:00
parent 02e32ae72f
commit 76fa734d85
14 changed files with 143 additions and 160 deletions

View File

@ -1,2 +0,0 @@
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -1,4 +1,4 @@
-- options --------------------------------------------------------------------- -- options
vim.opt.tabstop = 2 vim.opt.tabstop = 2
vim.opt.shiftwidth = 2 vim.opt.shiftwidth = 2
vim.opt.expandtab = true vim.opt.expandtab = true

View File

@ -1,2 +0,0 @@
-- treesitter ------------------------------------------------------------------
vim.treesitter.start()

View File

@ -1,4 +0,0 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
-- vim.opt.expandtab = true

View File

@ -1,4 +0,0 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true

View File

@ -1,7 +1,7 @@
-- options --------------------------------------------------------------------- -- options
vim.opt.tabstop = 2 vim.opt.tabstop = 2
vim.opt.shiftwidth = 2 vim.opt.shiftwidth = 2
vim.opt.expandtab = true vim.opt.expandtab = true
-- treesitter ------------------------------------------------------------------ -- treesitter
vim.treesitter.start() vim.treesitter.start()

View File

@ -1,9 +1,9 @@
-- options --------------------------------------------------------------------- -- options
vim.bo.tabstop = 2 vim.bo.tabstop = 2
vim.bo.shiftwidth = 2 vim.bo.shiftwidth = 2
vim.bo.expandtab = true vim.bo.expandtab = true
-- keymaps --------------------------------------------------------------------- -- keymaps
local keymap_set = vim.keymap.set local keymap_set = vim.keymap.set
keymap_set("n", "]h", "/\\_^#.*\\ze\\n\\{2}<esc>", {}) keymap_set("n", "]h", "/\\_^#.*\\ze\\n\\{2}<esc>", {})
keymap_set("n", "[h", "?\\_^#.*\\ze\\n\\{2}<esc>", {}) keymap_set("n", "[h", "?\\_^#.*\\ze\\n\\{2}<esc>", {})

View File

@ -1,4 +0,0 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

View File

@ -1,4 +0,0 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true

View File

@ -1,4 +0,0 @@
-- options ---------------------------------------------------------------------
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true

View File

@ -1,2 +1,2 @@
-- treesitter ------------------------------------------------------------------ -- treesitter
vim.treesitter.start() vim.treesitter.start()

View File

@ -6,7 +6,6 @@ endif
syntax clear markdownYamlHead syntax clear markdownYamlHead
syntax region markdownYamlHead start="^-\{3}\n\S" end="\S\n\%(-\|\.\)\{3}$" keepend contains=@markdownYamlTop,@Spell syntax region markdownYamlHead start="^-\{3}\n\S" end="\S\n\%(-\|\.\)\{3}$" keepend contains=@markdownYamlTop,@Spell
" citation " citation
syntax match markdownPCite "\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\_.\{-}\]" contains=@markdownInline,markdownCiteKey syntax match markdownPCite "\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\_.\{-}\]" contains=@markdownInline,markdownCiteKey
syn match markdownICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=markdownCiteKey,@Spell display syn match markdownICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=markdownCiteKey,@Spell display

View File

@ -5,32 +5,40 @@
-- colors ---------------------------------------------------------------------- -- colors ----------------------------------------------------------------------
local C = { local C = {
{ 0, "#000000" }, -- black black = { cterm = 0, gui = "#000000" },
{ 1, "#fa3500" }, -- red red = { cterm = 1, gui = "#fa3500" },
{ 2, "#009843" }, -- green green = { cterm = 2, gui = "#009843" },
{ 3, "#d06600" }, -- orange orange = { cterm = 3, gui = "#d06600" },
{ 4, "#856cff" }, -- blue blue = { cterm = 4, gui = "#856cff" },
{ 5, "#ff1170" }, -- magenta magenta = { cterm = 5, gui = "#ff1170" },
{ 6, "#008cca" }, -- cyan cyan = { cterm = 6, gui = "#008cca" },
{ 7, "#e2e2e2" }, -- white white = { cterm = 7, gui = "#e2e2e2" },
{ 8, "#848484" }, -- black bright_black = { cterm = 8, gui = "#848484" },
{ 9, "#ff888e" }, -- red bright_red = { cterm = 9, gui = "#ff888e" },
{ 10, "#00c55b" }, -- green bright_green = { cterm = 10, gui = "#00c55b" },
{ 11, "#ff8d48" }, -- orange bright_orange = { cterm = 11, gui = "#ff8d48" },
{ 12, "#ac9fff" }, -- blue bright_blue = { cterm = 12, gui = "#ac9fff" },
{ 13, "#ffb1c0" }, -- magenta bright_magenta = { cterm = 13, gui = "#ffb1c0" },
{ 14, "#92ccff" }, -- cyan bright_cyan = { cterm = 14, gui = "#92ccff" },
{ 15, "#ffffff" }, -- white bright_white = { cterm = 15, gui = "#ffffff" },
} }
local black_c = C[1] vim.g.terminal_color_0 = "#000000"
local red_c = C[2] vim.g.terminal_color_1 = "#fa3500"
local green_c = C[3] vim.g.terminal_color_2 = "#009843"
local orange_c = C[4] vim.g.terminal_color_3 = "#d06600"
local blue_c = C[5] vim.g.terminal_color_4 = "#856cff"
local magenta_c = C[6] vim.g.terminal_color_5 = "#ff1170"
local cyan_c = C[7] vim.g.terminal_color_6 = "#008cca"
local white_c = C[8] vim.g.terminal_color_7 = "#e2e2e2"
vim.g.terminal_color_8 = "#848484"
vim.g.terminal_color_9 = "#ff888e"
vim.g.terminal_color_10 = "#00c55b"
vim.g.terminal_color_11 = "#ff8d48"
vim.g.terminal_color_12 = "#ac9fff"
vim.g.terminal_color_13 = "#ffb1c0"
vim.g.terminal_color_14 = "#92ccff"
vim.g.terminal_color_15 = "#ffffff"
-- init ------------------------------------------------------------------------ -- init ------------------------------------------------------------------------
vim.cmd.highlight("clear") vim.cmd.highlight("clear")
@ -50,42 +58,11 @@ else
vim.opt.termguicolors = true vim.opt.termguicolors = true
end end
for _, v in ipairs(C) do
local key = ("terminal_color_%i"):format(v[1])
vim.g[key] = v[2]
end
-- highlights ------------------------------------------------------------------ -- highlights ------------------------------------------------------------------
local H = {} local fg = C.white
local bg = C.black
function H:new(o) local accent = C.magenta
o = o or {} local dimmed = C.blue
setmetatable(o, self)
self.__index = self
return o
end
function H:fg(c)
self.ctermfg = c[1]
self.fg = c[2]
return self
end
function H:bg(c)
self.ctermbg = c[1]
self.bg = c[2]
return self
end
function H:attr(a)
self[a] = true
return self
end
local fg_c = white_c
local bg_c = black_c
local accent_c = magenta_c
local dimmed_c = blue_c
local nvim_set_hl = vim.api.nvim_set_hl local nvim_set_hl = vim.api.nvim_set_hl
local function set_hl(group, def) nvim_set_hl(0, group, def) end local function set_hl(group, def) nvim_set_hl(0, group, def) end
@ -98,8 +75,8 @@ set_hl("NormalNC", normal_h)
-- tui ------------------------------------------------------------------------- -- tui -------------------------------------------------------------------------
local tui_normal_h = {} local tui_normal_h = {}
local tui_accent_h = H:new():fg(accent_c) local tui_accent_h = { ctermfg = accent.cterm, fg = accent.gui }
local tui_dimmed_h = H:new():fg(dimmed_c) local tui_dimmed_h = { ctermfg = dimmed.cterm, fg = dimmed.gui }
set_hl("StatusLine", tui_dimmed_h) set_hl("StatusLine", tui_dimmed_h)
set_hl("StatusLineNC", tui_dimmed_h) set_hl("StatusLineNC", tui_dimmed_h)
@ -117,17 +94,34 @@ set_hl("FoldColumn", tui_dimmed_h)
set_hl("WildMenu", tui_accent_h) set_hl("WildMenu", tui_accent_h)
-- float ----------------------------------------------------------------------- -- float -----------------------------------------------------------------------
local float_normal_h = H:new():fg(bg_c):bg(fg_c) local float_normal_h = { ctermfg = bg.cterm,
local float_accent_h = H:new():fg(accent_c):bg(fg_c) fg = bg.gui,
ctermbg = fg.cterm,
bg = fg.gui }
local float_dimmed_h = { ctermfg = dimmed.cterm,
fg = dimmed.gui,
ctermbg = fg.cterm,
bg = fg.gui }
local float_accent_h = { ctermfg = accent.cterm,
fg = accent.gui,
ctermbg = fg.cterm,
bg = fg.gui }
set_hl("NormalFloat", float_normal_h) set_hl("NormalFloat", float_normal_h)
set_hl("FloatBorder", float_normal_h) set_hl("FloatBorder", float_dimmed_h)
set_hl("FloatTitle", float_accent_h) set_hl("FloatTitle", float_accent_h)
-- menu ------------------------------------------------------------------------ -- menu ------------------------------------------------------------------------
local menu_normal_h = H:new():fg(bg_c):bg(fg_c) local menu_normal_h = { ctermfg = accent.cterm,
local menu_accent_h = H:new():fg(accent_c):bg(fg_c) fg = accent.gui,
local menu_accent_r_h = H:new():fg(accent_c):bg(fg_c):attr("reverse") ctermbg = fg.cterm,
bg = fg.gui }
local menu_accent_h = { ctermfg = accent.cterm,
fg = accent.gui,
ctermbg = fg.cterm,
bg = fg.gui,
reverse = true }
local test = { ctermfg, fg = 1, 2 }
set_hl("Pmenu", menu_normal_h) set_hl("Pmenu", menu_normal_h)
set_hl("PmenuSel", menu_accent_h) set_hl("PmenuSel", menu_accent_h)
@ -135,14 +129,14 @@ set_hl("PmenuKind", menu_normal_h)
set_hl("PmenuKindSel", menu_accent_h) set_hl("PmenuKindSel", menu_accent_h)
set_hl("PmenuExtra", menu_normal_h) set_hl("PmenuExtra", menu_normal_h)
set_hl("PmenuExtraSel", menu_accent_h) set_hl("PmenuExtraSel", menu_accent_h)
set_hl("PmenuSbar", menu_accent_h) set_hl("PmenuSbar", menu_normal_h)
set_hl("PmenuThumb", menu_accent_r_h) set_hl("PmenuThumb", menu_accent_h)
-- messages -------------------------------------------------------------------- -- messages --------------------------------------------------------------------
local message_normal_h = {} local message_normal_h = {}
local message_accent_h = H:new():fg(accent_c) local message_accent_h = { ctermfg = accent.cterm, fg = accent.gui }
local message_error_h = H:new():fg(red_c) local message_error_h = { ctermfg = C.red.cterm, fg = C.red.gui }
local message_warn_h = H:new():fg(orange_c) local message_warn_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
set_hl("MsgArea", message_normal_h) set_hl("MsgArea", message_normal_h)
set_hl("MsgSeparator", message_normal_h) set_hl("MsgSeparator", message_normal_h)
@ -154,9 +148,9 @@ set_hl("Question", message_accent_h)
set_hl("Title", message_accent_h) set_hl("Title", message_accent_h)
-- buffer ---------------------------------------------------------------------- -- buffer ----------------------------------------------------------------------
local buffer_normal_h = H:new():fg(dimmed_c) local buffer_normal_h = { ctermfg = dimmed.cterm, fg = dimmed.gui }
local buffer_normal_bg_h = H:new():bg(dimmed_c) local buffer_normal_bg_h = { ctermbg = dimmed.cterm, bg = dimmed.gui }
local buffer_accent_h = H:new():fg(accent_c) local buffer_accent_h = { ctermfg = accent.cterm, fg = accent.gui }
set_hl("Conceal", buffer_normal_h) set_hl("Conceal", buffer_normal_h)
set_hl("NonText", buffer_normal_h) set_hl("NonText", buffer_normal_h)
@ -167,7 +161,7 @@ set_hl("SpecialKey", buffer_accent_h)
set_hl("ColorColumn", buffer_normal_bg_h) set_hl("ColorColumn", buffer_normal_bg_h)
-- cursor ---------------------------------------------------------------------- -- cursor ----------------------------------------------------------------------
local cursor_normal_h = H:new():attr("reverse") local cursor_normal_h = { reverse = true }
set_hl("CursorLine", cursor_normal_h) set_hl("CursorLine", cursor_normal_h)
set_hl("CursorLineNr", cursor_normal_h) set_hl("CursorLineNr", cursor_normal_h)
@ -182,27 +176,39 @@ set_hl("TermCursor", cursor_normal_h)
set_hl("TermCursorNC", cursor_normal_h) set_hl("TermCursorNC", cursor_normal_h)
-- match ----------------------------------------------------------------------- -- match -----------------------------------------------------------------------
local match_normal_h = H:new():fg(black_c):bg(orange_c) local match_normal_h = { ctermfg = C.black.cterm,
local match_current_h = H:new():fg(black_c):bg(magenta_c) fg = C.black.gui,
local match_paren_h = H:new():fg(magenta_c):bg(orange_c) ctermbg = C.orange.cterm,
bg = C.orange.gui }
local match_accent_h = { ctermfg = C.black.cterm,
fg = C.black.gui,
ctermbg = C.magenta.cterm,
bg = C.magenta.gui }
local match_dimmed_h = { ctermfg = C.magenta.cterm,
fg = C.magenta.gui,
ctermbg = C.white.cterm,
bg = C.white.gui }
set_hl("Search", match_normal_h) set_hl("Search", match_normal_h)
set_hl("Substitute", match_normal_h) set_hl("Substitute", match_normal_h)
set_hl("IncSearch", match_current_h) set_hl("IncSearch", match_accent_h)
set_hl("CurSearch", match_current_h) set_hl("CurSearch", match_accent_h)
set_hl("MatchParen", match_paren_h) set_hl("MatchParen", match_dimmed_h)
-- selection ------------------------------------------------------------------- -- selection -------------------------------------------------------------------
local selection_normal_h = H:new():fg(black_c):bg(white_c) local selection_normal_h = { ctermfg = C.black.cterm,
fg = C.black.gui,
ctermbg = C.blue.cterm,
bg = C.blue.gui }
set_hl("visual", selection_normal_h) set_hl("Visual", selection_normal_h)
set_hl("visualnos", selection_normal_h) set_hl("Visualnos", selection_normal_h)
-- diff ------------------------------------------------------------------------ -- diff ------------------------------------------------------------------------
local diff_add_h = H:new():fg(green_c) local diff_add_h = { ctermfg = C.green.cterm, fg = C.green.gui }
local diff_change_h = H:new():fg(orange_c) local diff_change_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
local diff_delete_h = H:new():fg(red_c) local diff_delete_h = { ctermfg = C.red.cterm, fg = C.red.gui }
local diff_text_h = H:new():fg(orange_c):attr("underline") local diff_text_h = { ctermfg = C.orange.cterm, fg = C.orange.gui, underline = true }
set_hl("DiffAdd", diff_add_h) set_hl("DiffAdd", diff_add_h)
set_hl("DiffChange", diff_change_h) set_hl("DiffChange", diff_change_h)
@ -210,8 +216,8 @@ set_hl("DiffDelete", diff_delete_h)
set_hl("DiffText", diff_text_h) set_hl("DiffText", diff_text_h)
-- spell ----------------------------------------------------------------------- -- spell -----------------------------------------------------------------------
local spell_error_h = H:new():fg(red_c):attr("underline") local spell_error_h = { ctermfg = C.red.cterm, fg = C.red.gui, underline = true }
local spell_warn_h = H:new():fg(orange_c):attr("underline") local spell_warn_h = { ctermfg = C.orange.cterm, fg = C.orange.gui, underline = true }
set_hl("SpellBad", spell_error_h) set_hl("SpellBad", spell_error_h)
set_hl("SpellCap", spell_warn_h) set_hl("SpellCap", spell_warn_h)
@ -219,16 +225,16 @@ set_hl("SpellLocal", spell_warn_h)
set_hl("SpellRare", spell_warn_h) set_hl("SpellRare", spell_warn_h)
-- diagnostic ------------------------------------------------------------------ -- diagnostic ------------------------------------------------------------------
local diagnostic_error_h = H:new():fg(red_c) local diagnostic_error_h = { ctermfg = C.red.cterm, fg = C.red.gui }
local diagnostic_warn_h = H:new():fg(orange_c) local diagnostic_warn_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
local diagnostic_info_h = H:new():fg(blue_c) local diagnostic_info_h = { ctermfg = C.blue.cterm, fg = C.blue.gui }
local diagnostic_hint_h = H:new():fg(white_c) local diagnostic_hint_h = { ctermfg = C.white.cterm, fg = C.white.gui }
local diagnostic_ok_h = H:new():fg(green_c) local diagnostic_ok_h = { ctermfg = C.green.cterm, fg = C.green.gui }
local diagnostic_error_u_h = H:new():fg(red_c):attr("underline") local diagnostic_error_u_h = { ctermfg = C.red.cterm, fg = C.red.gui, underline = true }
local diagnostic_warn_u_h = H:new():fg(orange_c):attr("underline") local diagnostic_warn_u_h = { ctermfg = C.orange.cterm, fg = C.orange.gui, underline = true }
local diagnostic_info_u_h = H:new():fg(blue_c):attr("underline") local diagnostic_info_u_h = { ctermfg = C.blue.cterm, fg = C.blue.gui, underline = true }
local diagnostic_hint_u_h = H:new():fg(white_c):attr("underline") local diagnostic_hint_u_h = { ctermfg = C.white.cterm, fg = C.white.gui, underline = true }
local diagnostic_ok_u_h = H:new():fg(green_c):attr("underline") local diagnostic_ok_u_h = { ctermfg = C.green.cterm, fg = C.green.gui, underline = true }
set_hl("DiagnosticError", diagnostic_error_h) set_hl("DiagnosticError", diagnostic_error_h)
set_hl("DiagnosticWarn", diagnostic_warn_h) set_hl("DiagnosticWarn", diagnostic_warn_h)
@ -259,26 +265,26 @@ set_hl("DiagnosticDeprecated", diagnostic_hint_u_h)
set_hl("DiagnosticUnnecessary", diagnostic_hint_u_h) set_hl("DiagnosticUnnecessary", diagnostic_hint_u_h)
-- misc ------------------------------------------------------------------------ -- misc ------------------------------------------------------------------------
set_hl("Directory", H:new():fg(blue_c)) set_hl("Directory", { ctermfg = C.blue.cterm, fg = C.blue.gui })
-- syntax ---------------------------------------------------------------------- -- syntax ----------------------------------------------------------------------
local syntax_normal_h = {} local syntax_normal_h = {}
local syntax_comment_h = H:new():fg(blue_c) local syntax_comment_h = { ctermfg = C.blue.cterm, fg = C.blue.gui }
local syntax_constant_h = H:new():fg(red_c) local syntax_constant_h = { ctermfg = C.red.cterm, fg = C.red.gui }
local syntax_identifier_h = H:new() local syntax_identifier_h = {}
local syntax_statement_h = H:new():fg(orange_c) local syntax_statement_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
local syntax_preproc_h = H:new():fg(magenta_c) local syntax_preproc_h = { ctermfg = C.magenta.cterm, fg = C.magenta.gui }
local syntax_type_h = H:new():fg(green_c) local syntax_type_h = { ctermfg = C.green.cterm, fg = C.green.gui }
local syntax_special_h = H:new():fg(orange_c) local syntax_special_h = { ctermfg = C.orange.cterm, fg = C.orange.gui }
local syntax_underline_h = H:new():fg(blue_c):attr("underline") local syntax_underline_h = { ctermfg = C.blue.cterm, fg = C.blue.gui, underline = true }
local syntax_ignore_h = H:new():fg(black_c) local syntax_ignore_h = { ctermfg = C.black.cterm, fg = C.black.gui }
local syntax_error_h = H:new():fg(black_c):bg(red_c) local syntax_error_h = { ctermfg = C.black.cterm, fg = C.black.gui, ctermbg = C.red.cterm, bg = C.red.gui }
local syntax_warn_h = H:new():fg(black_c):bg(orange_c) local syntax_warn_h = { ctermfg = C.black.cterm, fg = C.black.gui, ctermbg = C.orange.cterm, bg = C.orange.gui }
local syntax_italic_h = H:new():attr("italic") local syntax_italic_h = { italic = true }
local syntax_bold_h = H:new():attr("bold") local syntax_bold_h = { bold = true }
local syntax_bolditalic_h = H:new():attr("bold"):attr("italic") local syntax_bolditalic_h = { bold = true, italic = true }
local syntax_strike_h = H:new():attr("strikethrough") local syntax_strike_h = { strikethrough = true }
set_hl("Comment", syntax_comment_h) set_hl("Comment", syntax_comment_h)
set_hl("Constant", syntax_constant_h) set_hl("Constant", syntax_constant_h)
@ -322,9 +328,9 @@ set_hl("BoldItalic", syntax_bolditalic_h)
set_hl("Strike", syntax_strike_h) set_hl("Strike", syntax_strike_h)
-- markdown -------------------------------------------------------------------- -- markdown --------------------------------------------------------------------
local markdown_label_h = H:new():fg(magenta_c) local markdown_label_h = { ctermfg = C.magenta.cterm, fg = C.magenta.gui }
local markdown_delimiter_h = H:new():fg(blue_c) local markdown_delimiter_h = { ctermfg = C.blue.cterm, fg = C.blue.gui }
local markdown_underline_h = H:new():fg(blue_c):attr("underline") local markdown_underline_h = { ctermfg = C.blue.cterm, fg = C.blue.gui, underline = true }
set_hl("markdownLabel", markdown_label_h) set_hl("markdownLabel", markdown_label_h)
set_hl("markdownHeadingDelimiter", markdown_delimiter_h) set_hl("markdownHeadingDelimiter", markdown_delimiter_h)

View File

@ -17,18 +17,17 @@ opt.signcolumn = "number"
opt.textwidth = 80 opt.textwidth = 80
opt.colorcolumn = "+1" opt.colorcolumn = "+1"
opt.expandtab = true
opt.tabstop = 4
opt.shiftwidth = 2
opt.softtabstop = -1
opt.smarttab = true
opt.showtabline = 2 opt.showtabline = 2
opt.winbar = "%f%( %h%m%r%y%)" opt.winbar = "%f%( %h%m%r%y%)"
opt.laststatus = 3 opt.laststatus = 3
local statusline_group = api.nvim_create_augroup("Statusline", {}) local statusline_group = api.nvim_create_augroup("Statusline", {})
local wordcount = fn.wordcount()
api.nvim_create_autocmd({ "TextChanged", "WinEnter", "BufEnter" }, {
group = statusline_group,
callback = function()
wordcount = fn.wordcount()
end
})
local cwd = fn.pathshorten(vim.fn.getcwd()) local cwd = fn.pathshorten(vim.fn.getcwd())
api.nvim_create_autocmd({ "DirChanged" }, { api.nvim_create_autocmd({ "DirChanged" }, {
group = statusline_group, group = statusline_group,
@ -38,6 +37,7 @@ api.nvim_create_autocmd({ "DirChanged" }, {
}) })
function _G.statusline() function _G.statusline()
local wordcount = fn.wordcount()
return table.concat({ return table.concat({
cwd, cwd,
" %=", " %=",
@ -87,7 +87,7 @@ api.nvim_create_autocmd({ "TermOpen" }, {
-- keymaps --------------------------------------------------------------------- -- keymaps ---------------------------------------------------------------------
local keymap_set = vim.keymap.set local keymap_set = vim.keymap.set
keymap_set( "n", "<esc>", function() keymap_set("n", "<esc>", function()
cmd.nohlsearch() cmd.nohlsearch()
end, { desc = "Stop the highlighting for the 'hlsearch' option" }) end, { desc = "Stop the highlighting for the 'hlsearch' option" })
@ -138,7 +138,9 @@ keymap_set("n", "<leader>g", function()
end) end)
if not file then return end if not file then return end
cmd.vimgrep(pattern, file) cmd.vimgrep(pattern, file)
end) end, { desc = ":vimgrep" })
keymap_set("i", "<c-f>", "<c-x><c-f>", { desc = "File name completion" })
-- netrw ----------------------------------------------------------------------- -- netrw -----------------------------------------------------------------------
local g = vim.g local g = vim.g