hachem.wtf
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-12-06 01:09:18 +0100
committerhachem <im@hachem.wtf>2025-12-06 01:09:18 +0100
commitbaf3946d1880a48372be7638555972d46c66d632 (patch)
tree648b2f877b30154c2e06127bd041c54863e9434c
parente4e422111358a5ae65224422c0c1e89083caeeaf (diff)
update nvim
-rw-r--r--.config/nvim/init.lua841
1 files changed, 400 insertions, 441 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index e00017e..7ff6cb7 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1,502 +1,461 @@
-local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
-if not (vim.uv or vim.loop).fs_stat(lazypath) then
- local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
- local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
- if vim.v.shell_error ~= 0 then
- error('Error cloning lazy.nvim:\n' .. out)
- end
+-- BOOTSTRAP LAZY.NVIM
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "--branch=stable",
+ "https://github.com/folke/lazy.nvim.git",
+ lazypath,
+ })
end
vim.opt.rtp:prepend(lazypath)
-require('lazy').setup({
- 'tpope/vim-sleuth',
- 'preservim/nerdtree',
- 'lambdalisue/suda.vim',
- 'bullets-vim/bullets.vim',
- 'lukas-reineke/indent-blankline.nvim',
+vim.g.mapleader = " "
+vim.g.maplocalleader = " "
- {
- 'nvim-treesitter/nvim-treesitter',
- build = ':TSUpdate',
- config = function()
- require('nvim-treesitter.configs').setup({
- ensure_installed = { 'latex' }
- })
- end
- },
-
- {
- 'windwp/nvim-autopairs',
- opts = {}
- },
+require("lazy").setup({
- {
- 'rainglow/vim',
- config = function()
- vim.cmd [[colorscheme bold-contrast]]
- end
- },
+ -- UI / Usability
+ "tpope/vim-sleuth",
+ "lukas-reineke/indent-blankline.nvim",
+ "windwp/nvim-autopairs",
- {
- 'rcarriga/nvim-dap-ui',
- dependencies = {
- 'mfussenegger/nvim-dap',
- 'nvim-neotest/nvim-nio',
+ -- Better file explorer
+ {
+ "stevearc/oil.nvim",
+ opts = {
+ default_file_explorer = true,
+ view_options = { show_hidden = true },
+ },
},
- config = function()
- require('dapui').setup()
- end
- },
- {
- 'nvim-telescope/telescope.nvim',
- tag = '0.1.8',
- dependencies = {
- 'nvim-lua/plenary.nvim',
- }
- },
+ -- Theme
+ {
+ "luisiacc/gruvbox-baby",
+ name = "gruvbox-baby",
+ priority = 1000,
+ config = function()
+ vim.g.gruvbox_baby_background_color = "medium"
+ vim.g.gruvbox_baby_telescope_theme = 1
+ vim.g.gruvbox_baby_transparent_mode = 1
+
+ vim.cmd.colorscheme("gruvbox-baby")
+ end,
+ },
- {
- 'folke/noice.nvim',
- event = 'VeryLazy',
+{
+ "folke/noice.nvim",
+ event = "VeryLazy",
dependencies = {
- 'MunifTanjim/nui.nvim',
- 'hrsh7th/nvim-cmp',
+ "MunifTanjim/nui.nvim",
+ "rcarriga/nvim-notify",
},
config = function()
- require('noice').setup({
- lsp = {
- override = {
- ['vim.lsp.util.convert_input_to_markdown_lines'] = true,
- ['cmp.entry.get_documentation'] = true
- },
- },
+ require("noice").setup({
+ presets = {
+ bottom_search = true,
+ command_palette = true,
+ long_message_to_split = true,
+ inc_rename = false,
+ lsp_doc_border = true,
+ },
- presets = {
- bottom_search = true,
- command_palette = true,
- long_message_to_split = true,
- inc_rename = false,
- lsp_doc_border = false,
- }
- })
- end,
- },
+ --- ASCII-only UI patch
+ routes = {
+ {
+ filter = { event = "msg_show", kind = "", find = "" },
+ opts = { skip = true },
+ },
+ },
- {
- 'Bilal2453/luvit-meta',
- lazy = true
- },
+ cmdline = {
+ format = {
+ cmdline = { icon = ":" },
+ search_down = { icon = "/" },
+ search_up = { icon = "?" },
+ },
+ },
- {
- 'neovim/nvim-lspconfig',
- dependencies = {
- {
- 'j-hui/fidget.nvim',
- opts = {}
- },
+ lsp = {
+ progress = {
+ enabled = true,
+ format = {
+ progress = function(message)
+ return string.format(
+ "%s [%s%%]",
+ message.title or "LSP",
+ message.percentage or "?"
+ )
+ end,
+ },
+ format_done = function(message)
+ return "LSP done"
+ end,
+ },
+ },
+ })
- {
- 'williamboman/mason.nvim',
- config = true
- },
+ -- nvim-notify ASCII settings
+ local notify = require("notify")
+ notify.setup({
+ render = "compact",
+ stages = "static",
+ icons = {
+ ERROR = "E",
+ WARN = "W",
+ INFO = "I",
+ DEBUG = ">",
+ TRACE = "-",
+ },
+ })
+ vim.notify = notify
+ end,
+},
+ -- Lualine — ASCII only UI
+ {
+ "nvim-lualine/lualine.nvim",
+ config = function()
+ local lualine = require("lualine")
- 'williamboman/mason-lspconfig.nvim',
- 'WhoIsSethDaniel/mason-tool-installer.nvim',
- 'hrsh7th/cmp-nvim-lsp',
- },
+ local colors = {
+ bg = "NONE",
+ fg = "#bbc2cf",
+ yellow = "#ECBE7B",
+ cyan = "#008080",
+ green = "#98be65",
+ orange = "#FF8800",
+ violet = "#a9a1e1",
+ magenta = "#c678dd",
+ blue = "#51afef",
+ red = "#ec5f67",
+ }
- config = function()
- vim.api.nvim_create_autocmd('LspAttach', {
- group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
- callback = function(event)
- local map = function(keys, func, desc, mode)
- mode = mode or 'n'
- vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
- end
+ local conditions = {
+ buffer_not_empty = function()
+ return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
+ end,
+ hide_in_width = function()
+ return vim.fn.winwidth(0) > 80
+ end,
+ }
- map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
- map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
- map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
- map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
- map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
- map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
- map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
- map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
- map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
- local client = vim.lsp.get_client_by_id(event.data.client_id)
- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
- local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
- buffer = event.buf,
- group = highlight_augroup,
- callback = vim.lsp.buf.document_highlight,
+ local config = {
+ options = {
+ globalstatus = true, -- sits at bottom
+ component_separators = "",
+ section_separators = "",
+ theme = {
+ normal = { c = { fg = colors.fg, bg = "NONE" } },
+ inactive = { c = { fg = colors.fg, bg = "NONE" } },
+ },
+ },
+ sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {},
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = {},
+ },
+ }
+
+ local function ins_left(component)
+ table.insert(config.sections.lualine_c, component)
+ end
+ local function ins_right(component)
+ table.insert(config.sections.lualine_x, component)
+ end
+
+ ins_left({
+ function() return "|" end,
+ color = { fg = colors.blue, bg = "NONE" },
})
- vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
- buffer = event.buf,
- group = highlight_augroup,
- callback = vim.lsp.buf.clear_references,
+ ins_left({
+ function() return "*" end,
+ color = function()
+ local mode_color = {
+ n = colors.red, i = colors.green, v = colors.blue,
+ V = colors.blue, c = colors.magenta, s = colors.orange,
+ S = colors.orange, ic = colors.yellow, R = colors.violet,
+ t = colors.red,
+ }
+ return { fg = mode_color[vim.fn.mode()], bg = "NONE" }
+ end,
})
- vim.api.nvim_create_autocmd('LspDetach', {
- group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
- callback = function(event2)
- vim.lsp.buf.clear_references()
- vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
- end,
+ ins_left({
+ "filesize",
+ cond = conditions.buffer_not_empty,
+ color = { bg = "NONE" },
})
- end
- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
- map('<leader>th', function()
- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
- end, '[T]oggle Inlay [H]ints')
- end
- end,
- })
+ ins_left({
+ "filename",
+ cond = conditions.buffer_not_empty,
+ color = { fg = colors.magenta, gui = "bold", bg = "NONE" },
+ })
- local capabilities = vim.lsp.protocol.make_client_capabilities()
- capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
- local servers = {
- clangd = {},
- rust_analyzer = {},
+ ins_left({ "location", color = { bg = "NONE" } })
+ ins_left({ "progress", color = { fg = colors.fg, gui = "bold", bg = "NONE" } })
- lua_ls = {
- settings = {
- Lua = {
- diagnostics = {
- globals = {
- 'vim',
- },
- },
- completion = {
- callSnippet = 'Replace',
- },
- },
- },
- },
- }
-
- require('mason').setup()
+ ins_left({
+ "diagnostics",
+ sources = { "nvim_diagnostic" },
+ symbols = { error = "E:", warn = "W:", info = "I:" },
+ })
- local ensure_installed = vim.tbl_keys(servers or {})
- vim.list_extend(ensure_installed, {
- 'stylua',
- })
- require('mason-tool-installer').setup { ensure_installed = ensure_installed }
+ ins_left({
+ function() return "%=" end,
+ })
- require('mason-lspconfig').setup {
- handlers = {
- function(server_name)
- local server = servers[server_name] or {}
- server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
- require('lspconfig')[server_name].setup(server)
- end,
- },
- }
- end,
- },
+ ins_left({
+ function()
+ local msg = "No LSP"
+ local buf_ft = vim.bo.filetype
+ for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0 })) do
+ local filetypes = client.config.filetypes
+ if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
+ return client.name
+ end
+ end
+ return msg
+ end,
+ icon = "LSP:",
+ color = { fg = "#ffffff", gui = "bold", bg = "NONE" },
+ })
- {
- 'nvim-lualine/lualine.nvim',
- dependencies = {
- 'nvim-tree/nvim-web-devicons',
- },
- config = function()
- local lualine = require('lualine')
+ ins_right({
+ "o:encoding",
+ fmt = string.upper,
+ color = { fg = colors.green, gui = "bold", bg = "NONE" },
+ })
- local colors = {
- bg = '#00000000',
- fg = '#bbc2cf',
- yellow = '#ECBE7B',
- cyan = '#008080',
- darkblue = '#081633',
- green = '#98be65',
- orange = '#FF8800',
- violet = '#a9a1e1',
- magenta = '#c678dd',
- blue = '#51afef',
- red = '#ec5f67',
- }
+ ins_right({
+ "fileformat",
+ fmt = string.upper,
+ icons_enabled = false,
+ color = { fg = colors.green, gui = "bold", bg = "NONE" },
+ })
- local conditions = {
- buffer_not_empty = function()
- return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
- end,
- hide_in_width = function()
- return vim.fn.winwidth(0) > 80
- end,
- check_git_workspace = function()
- local filepath = vim.fn.expand('%:p:h')
- local gitdir = vim.fn.finddir('.git', filepath .. ';')
- return gitdir and #gitdir > 0 and #gitdir < #filepath
- end,
- }
+ ins_right({
+ "branch",
+ icon = "git:",
+ color = { fg = colors.violet, gui = "bold", bg = "NONE" },
+ })
- local config = {
- options = {
- component_separators = '',
- section_separators = '',
- theme = {
- normal = { c = { fg = colors.fg, bg = colors.bg } },
- inactive = { c = { fg = colors.fg, bg = colors.bg } },
- },
- },
- sections = {
- lualine_a = {},
- lualine_b = {},
- lualine_y = {},
- lualine_z = {},
- lualine_c = {},
- lualine_x = {},
- },
- inactive_sections = {
- lualine_a = {},
- lualine_b = {},
- lualine_y = {},
- lualine_z = {},
- lualine_c = {},
- lualine_x = {},
- },
- }
+ ins_right({
+ "diff",
+ symbols = { added = "+", modified = "~", removed = "-" },
+ })
- local function ins_left(component)
- table.insert(config.sections.lualine_c, component)
- end
- local function ins_right(component)
- table.insert(config.sections.lualine_x, component)
- end
+ ins_right({
+ function() return "|" end,
+ color = { fg = colors.blue, bg = "NONE" },
+ })
- ins_left {
- function()
- return '▊'
- end,
- color = { fg = colors.blue },
- padding = { left = 0, right = 1 },
- }
+ lualine.setup(config)
- ins_left {
- function()
- return ''
- end,
- color = function()
- local mode_color = {
- n = colors.red,
- i = colors.green,
- v = colors.blue,
- [''] = colors.blue,
- V = colors.blue,
- c = colors.magenta,
- no = colors.red,
- s = colors.orange,
- S = colors.orange,
- [''] = colors.orange,
- ic = colors.yellow,
- R = colors.violet,
- Rv = colors.violet,
- cv = colors.red,
- ce = colors.red,
- r = colors.cyan,
- rm = colors.cyan,
- ['r?'] = colors.cyan,
- ['!'] = colors.red,
- t = colors.red,
- }
- return { fg = mode_color[vim.fn.mode()] }
+ vim.api.nvim_set_hl(0, "StatusLine", { bg = "NONE" })
+ vim.api.nvim_set_hl(0, "StatusLineNC", { bg = "NONE" })
end,
- padding = { right = 1 },
- }
+ },
- ins_left {
- 'filesize',
- cond = conditions.buffer_not_empty,
- }
+ -- Telescope
+ {
+ "nvim-telescope/telescope.nvim",
+ dependencies = { "nvim-lua/plenary.nvim" },
+ },
- ins_left {
- 'filename',
- cond = conditions.buffer_not_empty,
- color = { fg = colors.magenta, gui = 'bold' },
- }
+ -- Treesitter
+ {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ config = function()
+ require("nvim-treesitter.configs").setup({
+ highlight = { enable = true },
+ indent = { enable = true },
+ ensure_installed = {
+ "lua",
+ "vim",
+ "c",
+ "cpp",
+ "markdown",
+ "python",
+ "rust",
+ "bash",
+ },
+ })
+ end,
+ },
- ins_left { 'location' }
- ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
- ins_left {
- 'diagnostics',
- sources = { 'nvim_diagnostic' },
- symbols = { error = ' ', warn = ' ', info = ' ' },
- diagnostics_color = {
- error = { fg = colors.red },
- warn = { fg = colors.yellow },
- info = { fg = colors.cyan },
+ -- Completion
+ {
+ "hrsh7th/nvim-cmp",
+ dependencies = {
+ "hrsh7th/cmp-nvim-lsp",
+ "saadparwaiz1/cmp_luasnip",
+ "L3MON4D3/LuaSnip",
+ "rafamadriz/friendly-snippets",
},
- }
+ config = function()
+ local cmp = require("cmp")
+ local luasnip = require("luasnip")
+ require("luasnip.loaders.from_vscode").lazy_load()
- ins_left {
- function()
- return '%='
+ cmp.setup({
+ snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
+ mapping = cmp.mapping.preset.insert({
+ ["<CR>"] = cmp.mapping.confirm({ select = true }),
+ }),
+ sources = {
+ { name = "nvim_lsp" },
+ { name = "luasnip" },
+ },
+ })
end,
- }
+ },
- ins_left {
- function()
- local msg = 'No Active Lsp'
- local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
- local clients = vim.lsp.get_active_clients()
- if next(clients) == nil then
- return msg
- end
- for _, client in ipairs(clients) do
- local filetypes = client.config.filetypes
- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
- return client.name
- end
- end
- return msg
- end,
- icon = ' LSP:',
- color = { fg = '#ffffff', gui = 'bold' },
- }
+ -- LSP
+ {
+ "neovim/nvim-lspconfig",
+ dependencies = {
+ "williamboman/mason.nvim",
+ "williamboman/mason-lspconfig.nvim",
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
+ "hrsh7th/cmp-nvim-lsp",
+ "j-hui/fidget.nvim",
+ },
+ config = function()
+ require("mason").setup()
+ require("fidget").setup()
- ins_right {
- 'o:encoding',
- fmt = string.upper,
- cond = conditions.hide_in_width,
- color = { fg = colors.green, gui = 'bold' },
- }
+ local servers = {
+ lua_ls = {
+ settings = {
+ Lua = {
+ diagnostics = { globals = { "vim" } },
+ completion = { callSnippet = "Replace" },
+ },
+ },
+ },
+ }
- ins_right {
- 'fileformat',
- fmt = string.upper,
- icons_enabled = false,
- color = { fg = colors.green, gui = 'bold' },
- }
+ require("mason-tool-installer").setup({
+ ensure_installed = vim.tbl_keys(servers),
+ })
+
+ local capabilities = require("cmp_nvim_lsp").default_capabilities()
- ins_right {
- 'branch',
- icon = '',
- color = { fg = colors.violet, gui = 'bold' },
- }
+ require("mason-lspconfig").setup({
+ handlers = {
+ function(server)
+ require("lspconfig")[server].setup({
+ capabilities = capabilities,
+ settings = servers[server],
+ })
+ end,
+ },
+ })
+ end,
+ },
- ins_right {
- 'diff',
- symbols = { added = ' ', modified = '󰝤 ', removed = ' ' },
- diff_color = {
- added = { fg = colors.green },
- modified = { fg = colors.orange },
- removed = { fg = colors.red },
+ -- Formatting
+ {
+ "stevearc/conform.nvim",
+ opts = {
+ formatters_by_ft = {
+ lua = { "stylua" },
+ python = { "black" },
+ },
},
- cond = conditions.hide_in_width,
- }
+ },
- ins_right {
- function()
- return '▊'
+ -- Git signs (ASCII)
+ {
+ "lewis6991/gitsigns.nvim",
+ config = function()
+ require("gitsigns").setup({
+ signs = {
+ add = { text = "+" },
+ change = { text = "~" },
+ delete = { text = "-" },
+ topdelete = { text = "-" },
+ changedelete = { text = "~" },
+ },
+ })
end,
- color = { fg = colors.blue },
- padding = { left = 1 },
- }
-
- lualine.setup(config)
- end
- },
+ },
- {
- 'jbyuki/nabla.nvim',
- config = function()
- require('nabla').enable_virt({
- autogen = true,
- silent = true,
- })
- end
- },
+ -- Which-key
+ {
+ "folke/which-key.nvim",
+ config = function()
+ require("which-key").setup()
+ end,
+ },
})
-vim.g.mapleader = ' '
-vim.g.maplocalleader = ' '
-
-vim.opt.number = true
-vim.opt.mouse = 'a'
-vim.opt.showmode = false
-vim.opt.breakindent = false
-vim.opt.wrap = false
-vim.opt.undofile = false
-vim.opt.inccommand = 'split'
-vim.opt.clipboard = 'unnamedplus'
-vim.opt.cursorline = true
-vim.opt.scrolloff = 10
-vim.opt.ignorecase = true
-vim.opt.smartcase = true
-vim.opt.splitright = true
-vim.opt.splitbelow = true
-vim.opt.tabstop = 4
-vim.opt.shiftwidth = 4
-vim.opt.expandtab = true
-vim.opt.smartindent = true
-vim.opt.autoindent = true
-vim.opt.termguicolors = true
-vim.opt.fillchars.vert = ' '
-vim.opt.fillchars.eob = ' '
-
-vim.g.NERDTreeMinimalUI = true
-vim.g.NERDTreeWinPos = 'right'
-vim.g.NERDTreeWinSize = 20
-
-vim.keymap.set('n', 'j', 'gj')
-vim.keymap.set('n', 'k', 'gk')
+-- CURSOR/SELECTION aesthetics
+vim.api.nvim_set_hl(0, "CursorLine", { bg = "#1c1c1c" })
+vim.api.nvim_set_hl(0, "Visual", { bg = "#262626" })
-vim.keymap.set('n', '<leader>p', ':lua require("nabla").popup()<CR>', { noremap = true })
+-- ASCII diagnostics
+vim.fn.sign_define("DiagnosticSignError", { text = "E", texthl = "DiagnosticError" })
+vim.fn.sign_define("DiagnosticSignWarn", { text = "W", texthl = "DiagnosticWarn" })
+vim.fn.sign_define("DiagnosticSignInfo", { text = "I", texthl = "DiagnosticInfo" })
+vim.fn.sign_define("DiagnosticSignHint", { text = "H", texthl = "DiagnosticHint" })
-vim.keymap.set('n', '<C-e>', '<CMD>NERDTreeToggle<CR>', { noremap = true })
-vim.keymap.set('n', '<C-t>', '<CMD>NERDTreeFocus<CR>', { noremap = true })
+-- OPTIONS
+local opt = vim.opt
+opt.number = true
+opt.mouse = "a"
+opt.splitright = true
+opt.splitbelow = true
+opt.smartindent = true
+opt.expandtab = true
+opt.shiftwidth = 4
+opt.tabstop = 4
+opt.ignorecase = true
+opt.smartcase = true
+opt.termguicolors = true
+opt.cursorline = true
+opt.scrolloff = 10
+opt.clipboard = "unnamedplus"
-vim.opt.list = true
-vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
+-- typo forgiveness
+vim.cmd([[
+ cnoreabbrev W w
+ cnoreabbrev Q q
+ cnoreabbrev WQ wq
+ cnoreabbrev Wq wq
+ cnoreabbrev wQ wq
+ cnoreabbrev WQA wqa
+ cnoreabbrev WQa wqa
+ cnoreabbrev Wqa wqa
+]])
-vim.keymap.set('n', '<Esc>', '<CMD>nohlsearch<CR>')
-vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>')
+-- KEYMAPS
+local map = vim.keymap.set
+map("n", "<Esc>", ":nohl<CR>")
+map("n", "-", require("oil").open, { desc = "Open parent directory" })
-vim.keymap.set('n', '<C-h>', '<CMD>vertical resize -3<CR>', { noremap = true })
-vim.keymap.set('n', '<C-l>', '<CMD>vertical resize +3<CR>', { noremap = true })
-vim.keymap.set('n', '<C-j>', '<CMD>resize -3<CR>', { noremap = true })
-vim.keymap.set('n', '<C-k>', '<CMD>resize +3<CR>', { noremap = true })
+local telescope = require("telescope.builtin")
+map("n", "<leader>ff", telescope.find_files)
+map("n", "<leader>fg", telescope.live_grep)
+map("n", "<leader>fb", telescope.buffers)
-vim.keymap.set('n', 'j', 'gj', { noremap = true })
-vim.keymap.set('n', 'k', 'gk', { noremap = true })
-vim.keymap.set('n', ';', ':', { noremap = true })
-vim.keymap.set('v', ';', ':', { noremap = true })
-vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { noremap = true })
-vim.keymap.set('', 'Q', '<Nop>', { noremap = false })
-
-local telescope_builtin = require('telescope.builtin')
-vim.keymap.set('n', '<leader>ff', telescope_builtin.find_files)
-vim.keymap.set('n', '<leader>fg', telescope_builtin.live_grep)
-vim.keymap.set('n', '<leader>fb', telescope_builtin.buffers)
-vim.keymap.set('n', '<leader>fh', telescope_builtin.help_tags)
-
-vim.api.nvim_create_autocmd('TextYankPost', {
- desc = 'Highlight when yanking (copying) text',
- group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
- callback = function()
- vim.highlight.on_yank()
- end,
+-- Yank highlight
+vim.api.nvim_create_autocmd("TextYankPost", {
+ callback = function() vim.highlight.on_yank() end,
})
-
-vim.g.bullets_enabled_file_types = { 'markdown', 'text', 'scratch' }
-
-vim.api.nvim_command [[
- hi Normal guibg=NONE
- hi Visual guibg=#212121
- hi NonText guibg=NONE
- hi StatusLine guibg=#000000
- hi SignColumn guibg=#000000 guifg=#000000
- hi EndOfBuffer guibg=NONE
- hi WinSeparator guifg=#000000 guibg=NONE
- hi Comment gui=italic
- hi Macro gui=bold
-
- command W w
- command Q q
- command WQ wq
- command Wq wq
-]]