vim config changes

This commit is contained in:
Tiago Sousa 2023-10-11 18:13:14 +01:00
parent 4e77df8c01
commit 9cf19bd3a4
9 changed files with 104 additions and 95 deletions

View file

@ -16,6 +16,6 @@ require('nvim-treesitter.configs').setup {
} }
require('orgmode').setup({ require('orgmode').setup({
org_agenda_files = { '~/Nextcloud/Documents/uni/**/*'}, org_agenda_files = { '~/Nextcloud/org/**/*'},
org_default_notes_file = '~/Nextcloud/Documents/uni/refile.org', org_default_notes_file = '~/Nextcloud/org/refile.org',
}) })

View file

@ -39,7 +39,6 @@ return require('packer').startup(function(use)
use("williamboman/mason-lspconfig.nvim") use("williamboman/mason-lspconfig.nvim")
use("hrsh7th/cmp-nvim-lsp") use("hrsh7th/cmp-nvim-lsp")
use("neovim/nvim-lspconfig") use("neovim/nvim-lspconfig")
use("mfussenegger/nvim-jdtls")
use("jose-elias-alvarez/null-ls.nvim") use("jose-elias-alvarez/null-ls.nvim")
use({ use({
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",

View file

@ -1,13 +1,9 @@
return require('packer').startup(function(use) return require('packer').startup(function(use)
-- Packer can manage itself -- Packer can manage itself
use("wbthomason/packer.nvim")
use("nvim-lua/plenary.nvim") use("nvim-lua/plenary.nvim")
use("nvim-lua/popup.nvim") use("nvim-lua/popup.nvim")
use("nvim-telescope/telescope.nvim") use("nvim-telescope/telescope.nvim")
use("tpope/vim-surround") use("tpope/vim-surround")
use("tpope/vim-fugitive")
use("theprimeagen/harpoon")
use("mbbill/undotree") use("mbbill/undotree")
-- fidget change when rewrite version comes out -- fidget change when rewrite version comes out
@ -25,15 +21,6 @@ return require('packer').startup(function(use)
use("lervag/vimtex") use("lervag/vimtex")
use({
"hrsh7th/nvim-cmp",
requires = {
"hrsh7th/cmp-nvim-lsp", -- lsp
"hrsh7th/cmp-buffer", --buffer completions
"hrsh7th/cmp-path", --path completions
"hrsh7th/cmp-cmdline" --cmdline completions
},
})
use("williamboman/mason.nvim") use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim") use("williamboman/mason-lspconfig.nvim")
@ -52,10 +39,6 @@ return require('packer').startup(function(use)
run = ":TSUpdate" run = ":TSUpdate"
}) })
use("nvim-orgmode/orgmode")
use('nvim-lualine/lualine.nvim')
use("nvim-treesitter/playground") use("nvim-treesitter/playground")
use("romgrk/nvim-treesitter-context") use("romgrk/nvim-treesitter-context")

View file

@ -1,6 +1,7 @@
return { return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
dependencies = { event = "InsertEnter",
dependencies = {
'hrsh7th/cmp-nvim-lsp', -- lsp 'hrsh7th/cmp-nvim-lsp', -- lsp
'hrsh7th/cmp-nvim-lua', -- Nvim API completions 'hrsh7th/cmp-nvim-lua', -- Nvim API completions
'hrsh7th/cmp-nvim-lsp-signature-help', -- Show function signatures 'hrsh7th/cmp-nvim-lsp-signature-help', -- Show function signatures
@ -11,7 +12,7 @@ return {
'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
}, },
opts = function(_, opts) config = function()
local cmp_status_ok, cmp = pcall(require, "cmp") local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then if not cmp_status_ok then
return return

View file

@ -1 +1,6 @@
vim.keymap.set("n", "<leader>gs", vim.cmd.Git) return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
end
}

View file

@ -1,10 +1,15 @@
local mark = require("harpoon.mark") return {
local ui = require("harpoon.ui") "theprimeagen/harpoon",
config = function()
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file) vim.keymap.set("n", "<leader>a", mark.add_file)
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu) vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-j>", function () ui.nav_file(1) end) vim.keymap.set("n", "<C-j>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-k>", function () ui.nav_file(2) end) vim.keymap.set("n", "<C-k>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-l>", function () ui.nav_file(3) end) vim.keymap.set("n", "<C-l>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-;>", function () ui.nav_file(4) end) vim.keymap.set("n", "<C-;>", function() ui.nav_file(4) end)
end
}

View file

@ -1,21 +1,26 @@
-- -- Load custom treesitter grammar for org filetype return {
require('orgmode').setup_ts_grammar() "nvim-orgmode/orgmode",
config = function()
-- -- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
-- Treesitter configuration -- Treesitter configuration
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop, -- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting -- highlighting will fallback to default Vim syntax highlighting
highlight = { highlight = {
enable = true, enable = true,
-- Required for spellcheck, some LaTex highlights and -- Required for spellcheck, some LaTex highlights and
-- code block highlights that do not have ts grammar -- code block highlights that do not have ts grammar
additional_vim_regex_highlighting = { 'org' }, additional_vim_regex_highlighting = { 'org' },
}, },
ensure_installed = { 'org' }, -- Or run :TSUpdate org ensure_installed = { 'org' }, -- Or run :TSUpdate org
}
require('orgmode').setup({
org_agenda_files = { '~/Nextcloud/Documents/uni/**/*' },
org_default_notes_file = '~/Nextcloud/Documents/uni/refile.org',
})
end
} }
require('orgmode').setup({
org_agenda_files = { '~/Nextcloud/Documents/uni/**/*'},
org_default_notes_file = '~/Nextcloud/Documents/uni/refile.org',
})

View file

@ -1,40 +1,45 @@
require('lualine').setup { return {
options = { "nvim-lualine/lualine.nvim",
icons_enabled = true, config = function()
theme = 'auto', require('lualine').setup {
component_separators = { left = '', right = ''}, options = {
section_separators = { left = '', right = ''}, icons_enabled = true,
disabled_filetypes = { theme = 'auto',
statusline = {}, component_separators = { left = '', right = '' },
winbar = {}, section_separators = { left = '', right = '' },
}, disabled_filetypes = {
ignore_focus = {}, statusline = {},
always_divide_middle = true, winbar = {},
globalstatus = false, },
refresh = { ignore_focus = {},
statusline = 1000, always_divide_middle = true,
tabline = 1000, globalstatus = false,
winbar = 1000, refresh = {
} statusline = 1000,
}, tabline = 1000,
sections = { winbar = 1000,
lualine_a = {'mode'}, }
lualine_b = {'branch', 'diff', 'diagnostics'}, },
lualine_c = {'filename'}, sections = {
lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_a = { 'mode' },
lualine_y = {'progress'}, lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_z = {'location'} lualine_c = { 'filename' },
}, lualine_x = { 'encoding', 'fileformat', 'filetype' },
inactive_sections = { lualine_y = { 'progress' },
lualine_a = {}, lualine_z = { 'location' }
lualine_b = {}, },
lualine_c = {'filename'}, inactive_sections = {
lualine_x = {'location'}, lualine_a = {},
lualine_y = {}, lualine_b = {},
lualine_z = {} lualine_c = { 'filename' },
}, lualine_x = { 'location' },
tabline = {}, lualine_y = {},
winbar = {}, lualine_z = {}
inactive_winbar = {}, },
extensions = {} tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
end
} }

View file

@ -1,9 +1,15 @@
require'nvim-treesitter.configs'.setup { return {
ensure_installed = {"lua","vim","python","rust","haskell","c","java", "bash","go"}, "nvim-treesitter/nvim-treesitter",
sync_install = false, run = "TSUpdate",
config = function()
endrequire 'nvim-treesitter.configs'.setup {
ensure_installed = { "lua", "vim", "python", "rust", "haskell", "c", "java", "bash", "go" },
sync_install = false,
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
}
end
} }