Update lvim settings

This commit is contained in:
ItsDrike 2022-11-19 22:11:47 +01:00
parent 216beedac2
commit efe9388a41
No known key found for this signature in database
GPG key ID: B014E761034AF742
7 changed files with 68 additions and 32 deletions

View file

@ -0,0 +1,2 @@
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.lua", command = "setlocal shiftwidth=2" })
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.lua", command = "setlocal tabstop=2" })

View file

@ -0,0 +1,2 @@
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.md", command = "setlocal tw=119" })
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.md", command = "SymbolsOutline" })

View file

@ -2,8 +2,6 @@
-- Delete all trailing whitespace on saving -- Delete all trailing whitespace on saving
vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*.py", command = [[%s/\s\+$//e]] }) vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*.py", command = [[%s/\s\+$//e]] })
-- Set text wrap to 119 characters
vim.api.nvim_create_autocmd("BufWinEnter", { pattern = "*.md", command = "setlocal tw=119" })
-- Jump to last position when opening a file -- Jump to last position when opening a file
vim.api.nvim_create_autocmd("BufReadPost", { vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "*", pattern = "*",

View file

@ -20,7 +20,6 @@ lvim.keys.normal_mode["<A-H>"] = ":BufferLineMovePrev<CR>"
-- Opening various menus -- Opening various menus
lvim.keys.normal_mode["<C-n>"] = ":NvimTreeFindFileToggle<CR>" lvim.keys.normal_mode["<C-n>"] = ":NvimTreeFindFileToggle<CR>"
lvim.keys.normal_mode["<C-f>"] = ":Lf<CR>" lvim.keys.normal_mode["<C-f>"] = ":Lf<CR>"
lvim.keys.normal_mode["<A-m>"] = ":MinimapToggle<CR>"
lvim.keys.normal_mode["<A-s>"] = ":SymbolsOutline<CR>" lvim.keys.normal_mode["<A-s>"] = ":SymbolsOutline<CR>"
-- Delete to void register -- Delete to void register
@ -41,6 +40,14 @@ lvim.keys.normal_mode["<F10>"] = ":DapStepOver<CR>"
lvim.keys.normal_mode["<F11>"] = ":DapStepInto<CR>" lvim.keys.normal_mode["<F11>"] = ":DapStepInto<CR>"
lvim.keys.normal_mode["<S-F11>"] = ":DapStepOut<CR>" lvim.keys.normal_mode["<S-F11>"] = ":DapStepOut<CR>"
-- Goto preview
lvim.keys.normal_mode["gpd"] = ":lua require('goto-preview').goto_preview_definition()<CR>"
lvim.keys.normal_mode["gpt"] = ":lua require('goto-preview').goto_preview_type_definition()<CR>"
lvim.keys.normal_mode["gpi"] = ":lua require('goto-preview').goto_preview_implementation()<CR>"
lvim.keys.normal_mode["gpr"] = ":lua require('goto-preview').goto_preview_references()<CR>"
lvim.keys.normal_mode["gP"] = ":lua require('goto-preview').close_all_win()<CR>"
-- Quick word replacing (use . for next word) -- Quick word replacing (use . for next word)
lvim.keys.normal_mode["cn"] = "*``cgn" lvim.keys.normal_mode["cn"] = "*``cgn"
lvim.keys.normal_mode["cN"] = "*``cgN" lvim.keys.normal_mode["cN"] = "*``cgN"

View file

@ -9,13 +9,9 @@ vim.opt.relativenumber = true -- Use relative line numbers
vim.opt.wrap = true -- Allow line wrapping vim.opt.wrap = true -- Allow line wrapping
-- Tab/Indent settings -- Tab/Indent settings
-- vim.opt.autoindent = true -- Enable automatic indenting vim.opt.shiftwidth = 4 -- Number of spaces inserted for each indentation (>>, <<)
-- vim.opt.expandtab = true -- Expand tabs into spaces vim.opt.tabstop = 4 -- Number of spaces a tab in file accounts for
-- vim.opt.tabstop = 2 -- Number of spaces a tab in file accounts for vim.opt.shiftround = true -- Always round indent to multiple of shiftwidth when indenting (>>, <<)
-- vim.opt.shiftwidth = 4 -- Visual number of spaces inserted for each indentation
-- vim.opt.softtabstop = 4 -- Tabs/Spaces interlop
-- vim.opt.tabpagemax = 50 -- More tabs
-- vim.opt.shiftround = true -- Always round indent to multiple of shiftwidth
-- --
-- Enable syntax highlighting in fenced markdown code-blocks -- Enable syntax highlighting in fenced markdown code-blocks
vim.g.markdown_fenced_languages = {"html", "javascript", "typescript", "css", "scss", "lua", "vim", "python"} vim.g.markdown_fenced_languages = {"html", "javascript", "typescript", "css", "scss", "lua", "vim", "python"}

View file

@ -1,8 +1,6 @@
-- Additional Plugins
lvim.plugins = { lvim.plugins = {
{ "wakatime/vim-wakatime" },
-- LSP -- LSP
{ {
-- Tree-like view for symbols in current file using LSP -- Tree-like view for symbols in current file using LSP
"simrat39/symbols-outline.nvim", "simrat39/symbols-outline.nvim",
@ -23,17 +21,18 @@ lvim.plugins = {
}, },
-- User interface -- User interface
-- Autocompletion
{ {
-- Code minimap for easy orientation in a longer file -- Local AI completion helper
"wfxr/minimap.vim", "tzachar/cmp-tabnine",
run = "cargo install --locked code-minimap", run = "./install.sh",
config = function() requires = "hrsh7th/nvim-cmp",
vim.cmd "let g:minimap_width = 10"
end,
}, },
-- Github copilot for code completion
-- { -- {
-- -- Github copilot for code completion
-- "zbirenbaum/copilot.lua", -- "zbirenbaum/copilot.lua",
-- event = { "VimEnter" }, -- event = { "VimEnter" },
-- config = function() -- config = function()
@ -42,23 +41,25 @@ lvim.plugins = {
-- end, 100) -- end, 100)
-- end, -- end,
-- }, -- },
-- { "zbirenbaum/copilot-cmp", after = { "copilot.lua", "nvim-cmp" } }, -- {
-- -- Github compilot cmp source
-- "zbirenbaum/copilot-cmp",
-- after = { "copilot.lua", "nvim-cmp" }
-- },
--
{ "jasonccox/vim-wayland-clipboard" },
-- Yuck.vim (eww configuration language support)
{ "elkowar/yuck.vim" },
-- Treesitter -- Treesitter
-- { -- {
-- -- Colorize matching parenthesis using treesitter -- -- Colorize matching parenthesis using treesitter
-- "p00f/nvim-ts-rainbow", -- "p00f/nvim-ts-rainbow",
-- }, -- },
{ {
-- Treesitter information shown directly in neovim -- Treesitter information shown directly in neovim
"nvim-treesitter/playground", "nvim-treesitter/playground",
}, },
{ {
-- Alwats show class/function name we're in -- Alwats show class/function name we're in
"romgrk/nvim-treesitter-context", "romgrk/nvim-treesitter-context",
@ -86,8 +87,38 @@ lvim.plugins = {
} }
end, end,
}, },
-- Other
{
-- Code time & habit tracking
"wakatime/vim-wakatime"
},
{
-- Make clipboard work on wayland (using wl-copy)
"jasonccox/vim-wayland-clipboard"
},
{
-- eww configuration language support
"elkowar/yuck.vim"
},
{
-- Goto preview (definition/implementation/references)
"rmagatti/goto-preview",
config = function()
require('goto-preview').setup {}
end
},
} }
-- Register copilot as cmp source -- Register copilot as cmp source
-- lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)" -- lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)"
-- table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" }) -- table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" })
-- Register tabnine as cmp source
lvim.builtin.cmp.formatting.source_names["tabnine"] = "(Tabnine)"
table.insert(lvim.builtin.cmp.sources, { name = "tabnine" })

View file

@ -34,9 +34,9 @@ lvim.builtin.treesitter.highlight.enabled = true
-- local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername -- local ft_to_parser = require"nvim-treesitter.parsers".filetype_to_parsername
-- ft_to_parser.apparmor = "apparmor" -- ft_to_parser.apparmor = "apparmor"
-- Temporary treesitter -- Temporary mappings
lvim.keys.normal_mode["gu"] = ":TSUpdate apparmor<CR>" -- lvim.keys.normal_mode["gu"] = ":TSUpdate apparmor<CR>"
lvim.keys.normal_mode["gU"] = ":TSToggle apparmor<CR>" -- lvim.keys.normal_mode["gU"] = ":TSToggle apparmor<CR>"
lvim.keys.normal_mode["gt"] = ":TSPlaygroundToggle<CR>" -- lvim.keys.normal_mode["gt"] = ":TSPlaygroundToggle<CR>"
lvim.keys.normal_mode["gh"] = ":TSNodeUnderCursor<CR>" -- lvim.keys.normal_mode["gh"] = ":TSNodeUnderCursor<CR>"
lvim.keys.normal_mode["gH"] = ":TSHighlightCapturesUnderCursor<CR>" -- lvim.keys.normal_mode["gH"] = ":TSHighlightCapturesUnderCursor<CR>"