currently working plugins (and happy with)

This commit is contained in:
Joost Agterhoek 2024-09-06 22:15:53 +02:00
parent e603176927
commit 47696240f3
11 changed files with 136 additions and 10 deletions

2
ftplugin/c.lua Normal file
View File

@ -0,0 +1,2 @@
vim.cmd 'autocmd BufEnter * set formatoptions-=cro'
vim.cmd 'autocmd BufEnter * setlocal formatoptions-=cro'

1
ftplugin/markdown.lua Normal file
View File

@ -0,0 +1 @@
vim.opt_local.conceallevel = 2

17
ftplugin/python.lua Normal file
View File

@ -0,0 +1,17 @@
-- original from: https://stackoverflow.com/questions/76954973/how-to-set-keybindings-to-execute-python-files-in-neovim-using-the-built-in-term
local function run_curr_python_file_in_toggleterm()
local file_name = vim.api.nvim_buf_get_name(0)
local py_cmd = vim.api.nvim_replace_termcodes('python3 "' .. file_name .. '"<cr>', true, false, true)
-- local py_cmd = vim.api.nvim_replace_termcodes('python3 "' .. file_name .. '"<cr> <Esc> :ToggleTerm', true, false, true)
local end_cmd = vim.api.nvim_replace_termcodes('<C-d>', true, false, true)
vim.cmd ':ToggleTerm direction=float'
vim.api.nvim_feedkeys(py_cmd, 't', false)
vim.api.nvim_feedkeys(end_cmd, 't', false)
end
vim.keymap.set({ 'n' }, '<A-e>', '', {
desc = 'Run .py file via Neovim built-in terminal',
callback = run_curr_python_file_in_toggleterm,
})

View File

@ -6,6 +6,8 @@ vim.opt.termguicolors = true
-- 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;'
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua' package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua'
vim.opt_local.autochdir = true
-- END OF TESTING REGION -- END OF TESTING REGION
--[[ --[[
@ -176,6 +178,9 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
@ -579,10 +584,10 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, clangd = {},
-- gopls = {}, gopls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
-- Some languages (like typescript) have entire language plugins that can be useful: -- Some languages (like typescript) have entire language plugins that can be useful:
@ -890,12 +895,12 @@ require('lazy').setup({
-- Here are some example plugins that I've included in the Kickstart repository. -- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim). -- Uncomment any of the lines below to enable them (you will need to restart nvim).
-- --
-- require 'kickstart.plugins.debug', require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line', require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config. -- This is the easiest way to modularize your config.

View File

@ -0,0 +1,6 @@
return {
'Zeioth/compiler.nvim',
cmd = { 'CompilerOpen', 'CompilerToggleResults', 'CompilerRedo' },
dependencies = { 'stevearc/overseer.nvim', 'nvim-telescope/telescope.nvim' },
opts = {},
}

View File

@ -0,0 +1,11 @@
return {
'allaman/emoji.nvim',
ft = 'markdown',
dependencies = {
'hrsh7th/nvim-cmp',
'nvim-telescope/telescope.nvim',
},
config = function()
require('telescope').load_extension 'emoji'
end,
}

View File

@ -0,0 +1,17 @@
return {
{
'folke/noice.nvim',
event = 'VeryLazy',
opts = {
-- add any options here
},
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
'MunifTanjim/nui.nvim',
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
'rcarriga/nvim-notify',
},
},
}

View File

@ -22,5 +22,6 @@ return {
date_format = '%Y-%m-%d', date_format = '%Y-%m-%d',
time_format = '%H:%M', time_format = '%H:%M',
}, },
disable_frontmatter = true,
}, },
} }

View File

@ -0,0 +1,13 @@
return {
'stevearc/overseer.nvim',
commit = '6271cab7ccc4ca840faa93f54440ffae3a3918bd',
cmd = { 'CompilerOpen', 'CompilerToggleResults', 'CompilerRedo' },
opts = {
task_list = {
direction = 'bottom',
min_height = 25,
max_height = 25,
default_detail = 1,
},
},
}

View File

@ -0,0 +1,46 @@
return {
'TobinPalmer/pastify.nvim',
cmd = { 'Pastify', 'PastifyAfter' },
event = { 'BufReadPost' }, -- Load after the buffer is read, I like to be able to paste right away
keys = {
{ noremap = true, mode = 'x', '<leader>p', '<cmd>PastifyAfter<CR>' },
{ noremap = true, mode = 'n', '<leader>p', '<cmd>PastifyAfter<CR>' },
{ noremap = true, mode = 'n', '<leader>P', '<cmd>Pastify<CR>' },
},
config = function()
require('pastify').setup {
opts = {
absolute_path = false, -- use absolute or relative path to the working directory
apikey = '', -- Api key, required for online saving
local_path = '/assets/imgs/', -- The path to put local files in, ex ~/Projects/<name>/assets/images/<imgname>.png
save = 'local', -- Either 'local' or 'online' or 'local_file'
filename = function()
return vim.fn.expand '%:t:r' .. '_' .. os.date '%Y-%m-%d_%H-%M-%S'
end,
default_ft = 'markdown', -- Default filetype to use
},
ft = { -- Custom snippets for different filetypes, will replace $IMG$ with the image url
html = '<img src="$IMG$" alt="">',
markdown = '![]($IMG$)',
tex = [[\includegraphics[width=\linewidth]{$IMG$}]],
css = 'background-image: url("$IMG$");',
js = 'const img = new Image(); img.src = "$IMG$";',
xml = '<image src="$IMG$" />',
php = '<?php echo "<img src="$IMG$" alt="">"; ?>',
python = '# $IMG$',
java = '// $IMG$',
c = '// $IMG$',
cpp = '// $IMG$',
swift = '// $IMG$',
kotlin = '// $IMG$',
go = '// $IMG$',
typescript = '// $IMG$',
ruby = '# $IMG$',
vhdl = '-- $IMG$',
verilog = '// $IMG$',
systemverilog = '// $IMG$',
lua = '-- $IMG$',
},
}
end,
}

View File

@ -0,0 +1,7 @@
return {
'zakissimo/smoji.nvim',
config = function()
require 'smoji'
vim.keymap.set('n', '<Leader>em', '<CMD>Smoji<CR>')
end,
}