vim.g.mapleader = ' ' -- Space as the leader key vim.opt.conceallevel = 0 -- Don't hide markup like Markdown links vim.opt.mouse = 'a' -- Enables mouse support vim.opt.clipboard = 'unnamedplus' -- Enables clipboard vim.opt.breakindent = true -- Maintain indent through wrapped breaks vim.opt.ignorecase = true -- Case insensitive searching vim.opt.smartcase = true -- Case sensitive searching if mixed case vim.opt.cursorline = true -- Highlight the active line vim.wo.wrap = true -- Line wrapping vim.wo.linebreak = true -- Word-based word wrapping -- Enable spell check when editing .gmi and .md files: vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, { pattern = {"*.gmi", "*.md"}, callback = function() vim.opt_local.spell = true vim.opt_local.spelllang = "en_us" end }) -- Install Lazy plugin manager 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', 'https://github.com/folke/lazy.nvim.git', '--branch=stable', lazypath, } end vim.opt.rtp:prepend(lazypath) -- Install Lazy plugins require('lazy').setup({ spec = { { 'folke/which-key.nvim', opts = { icons = { mappings = false } }, }, { "https://codeberg.org/historia/simple-denote.nvim", opts = { ext = "md", -- Note file extension (e.g. md, org, norg) dir = "~/notes", -- Notes directory (should already exist) add_heading = true, -- Add a md/org heading to new notes retitle_heading = true, -- Replace the first line with a new heading when retitling }, }, { "https://codeberg.org/historia/denote-fzf-lua", opts = { dir = "~/notes", -- Which filename fields appear in the search results table search_fields = { path = false, date = false, time = false, sig = false, title = true, keywords = true, ext = false, }, -- Regular options for fzf-lua, see fzf-lua documentation fzf_lua_opts = { winopts = { height = 0.85, width = 0.80, row = 0.35, col = 0.50, preview = { layout = 'vertical', vertical = 'down:45%', } }, fzf_opts = { ['--layout'] = false, ['--info'] = false, ['--reverse'] = true, ['--no-info'] = true, ['--no-separator'] = false, ['--no-hscroll'] = true, ['-i'] = true, }, }, }, }, { 'SCJangra/table-nvim', ft = 'markdown', opts = {}, }, { "HakonHarnes/img-clip.nvim", event = "VeryLazy", opts = { }, keys = { { "p", "PasteImage", desc = "Paste image from system clipboard" }, }, }, { "ibhagwan/fzf-lua", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() require("fzf-lua").setup({}) end }, { 'navarasu/onedark.nvim', priority = 1000, config = function() vim.cmd.colorscheme 'onedark' end, }, { 'nvim-lualine/lualine.nvim', opts = { options = { icons_enabled = false, theme = 'onedark', component_separators = '|', section_separators = '', }, }, }, { 'nvim-treesitter/nvim-treesitter', dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects', }, build = ':TSUpdate', }, } }) -- Remap k and j to gk and gj for wrapped text vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) -- Remap escape to unhighlight search results vim.keymap.set('n', '', 'nohlsearch') -- Keymaps to create, rename, and search notes vim.keymap.set({'n','v'}, 'nn', ":Denote note", { desc = "New note" }) vim.keymap.set({'n','v'}, 'nt', ":Denote title", { desc = "Change title" }) vim.keymap.set({'n','v'}, 'nk', ":Denote keywords", { desc = "Change keywords" }) vim.keymap.set({'n','v'}, 'nz', ":Denote signature", { desc = "Change signature" }) vim.keymap.set({'n','v'}, 'ne', ":Denote extension", { desc = "Change extension" }) vim.keymap.set({'n','v'}, 'ns', ":DenoteSearch files", { desc = "Search note filenames" }) vim.keymap.set({'n','v'}, 'nc', ":DenoteSearch contents", { desc = "Search note contents" }) -- Kepmap to toggle spell check vim.keymap.set({'n','v'}, 'sc', ':setlocal spell! spelllang=en_us', { desc = "Toggle spell check" })