Skip to content

Commit

Permalink
Some more stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
HankiGreed committed Mar 19, 2024
1 parent 642580b commit 8525aa8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 49 deletions.
1 change: 1 addition & 0 deletions lua/cmp-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cmp.setup {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer' }
},
}

Expand Down
6 changes: 6 additions & 0 deletions lua/custom/plugins/everforest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"sainnhe/everforest",
config = function()
vim.cmd.colorscheme 'everforest'
end,
}
7 changes: 7 additions & 0 deletions lua/custom/plugins/nvim-colorizer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
return {
'norcalli/nvim-colorizer.lua',
config = function()
vim.o.termguicolors = true
require('colorizer').setup()
end
}
24 changes: 24 additions & 0 deletions lua/custom/plugins/nvim-orgmode.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
return {
'nvim-orgmode/orgmode',
dependencies = {
{ 'nvim-treesitter/nvim-treesitter', lazy = true },
},
event = 'VeryLazy',
config = function()
-- Load treesitter grammar for org
require('orgmode').setup_ts_grammar()
-- Setup treesitter
require('nvim-treesitter.configs').setup({
highlight = {
enable = true,
},
ensure_installed = { 'org' },
})

-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/Documents/Notes/Organize/',
org_default_notes_file = '~/orgfiles/refile.org',
})
end,
}
9 changes: 4 additions & 5 deletions lua/lazy-plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ require('lazy').setup({
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',

-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
Expand All @@ -49,6 +45,9 @@ require('lazy').setup({
'rafamadriz/friendly-snippets',
},
},
{'hrsh7th/cmp-nvim-lsp-document-symbol'},
{'hrsh7th/cmp-cmdline'},
{'Dosx001/cmp-commit'},

-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
Expand Down Expand Up @@ -132,7 +131,7 @@ require('lazy').setup({
'navarasu/onedark.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
-- vim.cmd.colorscheme 'onedark'
end,
},

Expand Down
57 changes: 17 additions & 40 deletions lua/lsp-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,60 +61,37 @@ require('which-key').register({
['<leader>h'] = { 'Git [H]unk' },
}, { mode = 'v' })

-- mason-lspconfig requires that these setup functions are called in this order
-- before setting up the servers.
require('mason').setup()
require('mason-lspconfig').setup()
-- Setup neovim lua configuration
require('neodev').setup()

-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
--
-- If you want to override the default filetypes that your language server will attach to you can
-- define the property 'filetypes' to the map in question.
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
-- tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} },

clangd = {},
pylsp = {},
gopls = {},
pyright = {},
rust_analyzer = {},
rnix = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
diagnostics = { disable = { 'missing-fields' } },
},
},
}

-- Setup neovim lua configuration
require('neodev').setup()

-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)

-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'

mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}

mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
filetypes = (servers[server_name] or {}).filetypes,
}
end,
}
for name, settings in pairs(servers) do
require('lspconfig')[name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = settings,
-- filetypes = (servers[server_name] or {}).filetypes,
}
end

-- vim: ts=2 sts=2 sw=2 et
12 changes: 8 additions & 4 deletions lua/options.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
-- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!

-- Set highlight on search
vim.o.hlsearch = false
Expand All @@ -12,8 +10,6 @@ vim.wo.number = true
vim.o.mouse = 'a'

-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'

-- Enable break indent
Expand Down Expand Up @@ -47,4 +43,12 @@ vim.o.incsearch = true
vim.o.relativenumber = true
vim.o.number = true

-- Neovide Configs
if vim.g.neovide then
vim.o.guifont = "FiraCode Nerd Font Mono:h12"
end

-- Treesitter Based Folding
vim.o.foldmethod = "expr"
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
-- vim: ts=2 sts=2 sw=2 et

0 comments on commit 8525aa8

Please sign in to comment.