current nvim settings (obsidian frontmatter snippet, telescope heading, wrapping with yow, rose-pine theme, auto insert bullets)
This commit is contained in:
parent
927c5023eb
commit
9c9c0d0c8c
21
init.lua
21
init.lua
|
@ -4,7 +4,7 @@ vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
vim.g.vim_markdown_auto_insert_bullets = 0
|
-- vim.g.vim_markdown_auto_insert_bullets = 0
|
||||||
|
|
||||||
-- To make sure image.nvim works with luarocks
|
-- To make sure image.nvim works with luarocks
|
||||||
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;'
|
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;'
|
||||||
|
@ -16,7 +16,7 @@ vim.opt.spelllang = { 'en_us', 'nl' }
|
||||||
vim.opt.spell = true
|
vim.opt.spell = true
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-s>', ':!feh --geometry 640x480+1200+50 <cfile><CR>', { desc = 'Show image under cursor with feh' })
|
vim.keymap.set('n', '<C-s>', ':!feh --geometry 640x480+1200+50 <cfile><CR>', { desc = 'Show image under cursor with feh' })
|
||||||
vim.keymap.set('i', '<M-a>', '<Esc>[s1z=ea', { desc = 'Correct previous misspelt word with the first spell suggestion' })
|
vim.keymap.set('i', '<M-a>', '<Esc>[s1z=$a', { desc = 'Correct previous misspelt word with the first spell suggestion' })
|
||||||
vim.keymap.set('n', '<M-a>', '[s1z=$', { desc = 'Correct previous misspelt word with the first spell suggestion' })
|
vim.keymap.set('n', '<M-a>', '[s1z=$', { desc = 'Correct previous misspelt word with the first spell suggestion' })
|
||||||
|
|
||||||
require 'keymaps'
|
require 'keymaps'
|
||||||
|
@ -25,6 +25,8 @@ vim.opt.foldmethod = syntax
|
||||||
|
|
||||||
vim.opt.foldlevel = 99
|
vim.opt.foldlevel = 99
|
||||||
|
|
||||||
|
vim.g.autoread = true
|
||||||
|
|
||||||
vim.g.dictionary = true
|
vim.g.dictionary = true
|
||||||
vim.opt.complete:append { 'k' }
|
vim.opt.complete:append { 'k' }
|
||||||
|
|
||||||
|
@ -393,6 +395,12 @@ require('lazy').setup({
|
||||||
['ui-select'] = {
|
['ui-select'] = {
|
||||||
require('telescope.themes').get_dropdown(),
|
require('telescope.themes').get_dropdown(),
|
||||||
},
|
},
|
||||||
|
-- used to have sorted Markdown headings
|
||||||
|
heading = {
|
||||||
|
picker_opts = {
|
||||||
|
sorting_strategy = 'ascending', -- 'descending' by default
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +410,8 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
local builtin = require 'telescope.builtin'
|
local builtin = require 'telescope.builtin'
|
||||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
-- vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||||
|
vim.keymap.set('n', '<leader>sh', ':Telescope heading<CR>', { desc = '[S]earch [H]eading in Markdown' })
|
||||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||||
vim.keymap.set('n', '<leader>sb', ':Telescope neoclip<CR>', { desc = '[S]earch [B]uffers' })
|
vim.keymap.set('n', '<leader>sb', ':Telescope neoclip<CR>', { desc = '[S]earch [B]uffers' })
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
||||||
|
@ -856,15 +865,15 @@ require('lazy').setup({
|
||||||
-- change the command in the config to whatever the name of that colorscheme is.
|
-- change the command in the config to whatever the name of that colorscheme is.
|
||||||
--
|
--
|
||||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||||
-- 'folke/tokyonight.nvim',
|
'folke/tokyonight.nvim',
|
||||||
'catppuccin/nvim',
|
-- { 'rose-pine/neovim', name = 'rose-pine' },
|
||||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||||
init = function()
|
init = function()
|
||||||
-- Load the colorscheme here.
|
-- Load the colorscheme here.
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
-- vim.cmd.colorscheme 'tokyonight-night'
|
-- vim.cmd.colorscheme 'tokyonight-night'
|
||||||
vim.cmd.colorscheme 'catppuccin-macchiato'
|
vim.cmd.colorscheme 'rose-pine-moon'
|
||||||
|
|
||||||
-- You can configure highlights by doing something like:
|
-- You can configure highlights by doing something like:
|
||||||
vim.cmd.hi 'Comment gui=none'
|
vim.cmd.hi 'Comment gui=none'
|
||||||
|
|
|
@ -13,5 +13,25 @@ return {
|
||||||
-- If not available, we use `mini` as the fallback
|
-- If not available, we use `mini` as the fallback
|
||||||
-- 'rcarriga/nvim-notify',
|
-- 'rcarriga/nvim-notify',
|
||||||
},
|
},
|
||||||
|
config = function()
|
||||||
|
require('noice').setup {
|
||||||
|
lsp = {
|
||||||
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
override = {
|
||||||
|
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||||
|
['vim.lsp.util.stylize_markdown'] = true,
|
||||||
|
['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- you can enable a preset for easier configuration
|
||||||
|
presets = {
|
||||||
|
bottom_search = true, -- use a classic bottom cmdline for search
|
||||||
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
12
lua/custom/plugins/rose-pine.lua
Normal file
12
lua/custom/plugins/rose-pine.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
'rose-pine/neovim',
|
||||||
|
config = function()
|
||||||
|
require('rose-pine').setup {
|
||||||
|
styles = {
|
||||||
|
italic = false,
|
||||||
|
bold = true,
|
||||||
|
-- transparency = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
|
@ -5,6 +5,12 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require('nvim-surround').setup {
|
require('nvim-surround').setup {
|
||||||
-- Configuration here, or leave empty to use defaults
|
-- Configuration here, or leave empty to use defaults
|
||||||
|
surrounds = {
|
||||||
|
['('] = false,
|
||||||
|
},
|
||||||
|
aliases = {
|
||||||
|
['('] = ')',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
6
lua/custom/plugins/telescope-heading.lua
Normal file
6
lua/custom/plugins/telescope-heading.lua
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
return {
|
||||||
|
'crispgm/telescope-heading.nvim',
|
||||||
|
config = function()
|
||||||
|
require('telescope').load_extension 'heading'
|
||||||
|
end,
|
||||||
|
}
|
|
@ -1,6 +1,14 @@
|
||||||
|
local opts = {
|
||||||
|
set_nvim_opt_defaults = false,
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'andrewferrier/wrapping.nvim',
|
'andrewferrier/wrapping.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
require('wrapping').setup()
|
require('wrapping').setup {
|
||||||
|
|
||||||
|
-- set_nvim_opt_defaults = false,
|
||||||
|
softener = { markdown = true },
|
||||||
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,10 @@ local date = function()
|
||||||
return { os.date '%Y-%m-%d' }
|
return { os.date '%Y-%m-%d' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local filename = function()
|
||||||
|
return { vim.fn.expand '%:r:t' }
|
||||||
|
end
|
||||||
|
|
||||||
ls.add_snippets(nil, {
|
ls.add_snippets(nil, {
|
||||||
markdown = {
|
markdown = {
|
||||||
snip({
|
snip({
|
||||||
|
@ -34,5 +38,19 @@ ls.add_snippets(nil, {
|
||||||
text { '', '+++', '', '' },
|
text { '', '+++', '', '' },
|
||||||
insert(0),
|
insert(0),
|
||||||
}),
|
}),
|
||||||
|
snip({
|
||||||
|
trig = 'frontmatter',
|
||||||
|
namr = 'Obsidian frontmatter',
|
||||||
|
dscr = 'Frontmatter metadata for generic Obsidian note',
|
||||||
|
}, {
|
||||||
|
text { '---', 'title: ' },
|
||||||
|
func(filename, {}),
|
||||||
|
text { '', 'aliases: []' },
|
||||||
|
text { '', "tags: ['" },
|
||||||
|
insert(1, ''),
|
||||||
|
text { "']" },
|
||||||
|
text { '', '---', '' },
|
||||||
|
insert(0),
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user