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
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
vim.api.nvim_create_autocmd("BufReadPost", {
pattern = "*",

View file

@ -20,7 +20,6 @@ lvim.keys.normal_mode["<A-H>"] = ":BufferLineMovePrev<CR>"
-- Opening various menus
lvim.keys.normal_mode["<C-n>"] = ":NvimTreeFindFileToggle<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>"
-- 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["<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)
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
-- Tab/Indent settings
-- vim.opt.autoindent = true -- Enable automatic indenting
-- vim.opt.expandtab = true -- Expand tabs into spaces
-- vim.opt.tabstop = 2 -- Number of spaces a tab in file accounts for
-- 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
vim.opt.shiftwidth = 4 -- Number of spaces inserted for each indentation (>>, <<)
vim.opt.tabstop = 4 -- Number of spaces a tab in file accounts for
vim.opt.shiftround = true -- Always round indent to multiple of shiftwidth when indenting (>>, <<)
--
-- Enable syntax highlighting in fenced markdown code-blocks
vim.g.markdown_fenced_languages = {"html", "javascript", "typescript", "css", "scss", "lua", "vim", "python"}

View file

@ -1,8 +1,6 @@
-- Additional Plugins
lvim.plugins = {
{ "wakatime/vim-wakatime" },
-- LSP
{
-- Tree-like view for symbols in current file using LSP
"simrat39/symbols-outline.nvim",
@ -23,17 +21,18 @@ lvim.plugins = {
},
-- User interface
-- Autocompletion
{
-- Code minimap for easy orientation in a longer file
"wfxr/minimap.vim",
run = "cargo install --locked code-minimap",
config = function()
vim.cmd "let g:minimap_width = 10"
end,
-- Local AI completion helper
"tzachar/cmp-tabnine",
run = "./install.sh",
requires = "hrsh7th/nvim-cmp",
},
-- Github copilot for code completion
-- {
-- -- Github copilot for code completion
-- "zbirenbaum/copilot.lua",
-- event = { "VimEnter" },
-- config = function()
@ -42,23 +41,25 @@ lvim.plugins = {
-- end, 100)
-- 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
-- {
-- -- Colorize matching parenthesis using treesitter
-- "p00f/nvim-ts-rainbow",
-- },
{
-- Treesitter information shown directly in neovim
"nvim-treesitter/playground",
},
{
-- Alwats show class/function name we're in
"romgrk/nvim-treesitter-context",
@ -86,8 +87,38 @@ lvim.plugins = {
}
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
-- lvim.builtin.cmp.formatting.source_names["copilot"] = "(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
-- ft_to_parser.apparmor = "apparmor"
-- Temporary treesitter
lvim.keys.normal_mode["gu"] = ":TSUpdate apparmor<CR>"
lvim.keys.normal_mode["gU"] = ":TSToggle apparmor<CR>"
lvim.keys.normal_mode["gt"] = ":TSPlaygroundToggle<CR>"
lvim.keys.normal_mode["gh"] = ":TSNodeUnderCursor<CR>"
lvim.keys.normal_mode["gH"] = ":TSHighlightCapturesUnderCursor<CR>"
-- Temporary mappings
-- lvim.keys.normal_mode["gu"] = ":TSUpdate apparmor<CR>"
-- lvim.keys.normal_mode["gU"] = ":TSToggle apparmor<CR>"
-- lvim.keys.normal_mode["gt"] = ":TSPlaygroundToggle<CR>"
-- lvim.keys.normal_mode["gh"] = ":TSNodeUnderCursor<CR>"
-- lvim.keys.normal_mode["gH"] = ":TSHighlightCapturesUnderCursor<CR>"