Browse Source

Updated a bunch of things

master
Julio Biason 1 year ago
parent
commit
785dbf6d58
  1. 7
      nvim/after/plugin/colors.lua
  2. 4
      nvim/after/plugin/line.lua
  3. 67
      nvim/after/plugin/lsp.lua
  4. 6
      nvim/after/plugin/mindnvim.lua
  5. 36
      nvim/after/plugin/telecasten.lua
  6. 6
      nvim/after/plugin/treesitter.lua
  7. 24
      nvim/lua/packager.lua
  8. 2
      nvim/lua/set.lua
  9. 3
      starship/starship.toml

7
nvim/after/plugin/colors.lua

@ -1,12 +1,5 @@
vim.opt.background = "dark" -- the theme background is dark
vim.opt.termguicolors = true
-- vim.g.tokyonight_enable_italic = 1
-- vim.g.tokyonight_transparent = true
-- vim.cmd("colorscheme tokyonight-moon")
-- local ayu = require('ayu')
-- ayu.setup({ mirage = true })
-- ayu.colorscheme()
vim.cmd("colorscheme night-owl")

4
nvim/after/plugin/line.lua

@ -1,9 +1,7 @@
require("lualine").setup({
options = {
icons_enabled = true,
-- theme = 'ayu_mirage',
-- theme = 'tokyonight',
theme = 'nightowl',
theme = 'nightfly',
component_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
disabled_filetypes = {},

67
nvim/after/plugin/lsp.lua

@ -1,33 +1,42 @@
local attachment = function(client, bufnr)
local opts = { noremap=true, silent=true }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ga', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'v', 'ga', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.format({async = true})<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ge', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gn', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
if client.resolved_capabilities.document_formatting then
vim.api.nvim_command [[augroup Format]]
vim.api.nvim_command [[autocmd! * <buffer>]]
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format({async = false})]]
vim.api.nvim_command [[augroup END]]
end
end
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ 'n', 'v' }, '<space>ga', vim.lsp.buf.code_action, opts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true }
end, opts)
local servers = { 'pyright', 'rust_analyzer', 'clangd' }
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
on_attach = attachment
vim.keymap.set('n', 'ge', vim.diagnostic.open_float)
vim.keymap.set('n', 'gp', vim.diagnostic.goto_prev)
vim.keymap.set('n', 'gn', vim.diagnostic.goto_next)
end,
})
local lspconfig = require('lspconfig')
lspconfig.pyright.setup {}
lspconfig.rust_analyzer.setup {}
lspconfig.clangd.setup {}
require('lspconfig').groovyls.setup {
cmd = { "java", "-jar", "/home/jbiason/Projects/Personal/groovy-language-server/build/libs/groovy-language-server-all.jar" },
}
end

6
nvim/after/plugin/mindnvim.lua

@ -1,6 +0,0 @@
require("mind").setup({
persistence = {
state_path = "~/Documents/Mind/main.json",
data_dir = "~/Documents/Mind/data",
}
})

36
nvim/after/plugin/telecasten.lua

@ -1,36 +0,0 @@
-- local home = vim.fn.expand("~/Documents/Telecasten")
-- local tele = require('telekasten')
-- local options = { noremap = true, silent = true }
-- tele.setup({
-- home = home,
-- take_over_my_home = true,
-- auto_set_filetype = true,
-- dailies = home .. "/journal",
-- dalies_create_nonexisting = true,
-- template_new_daily = home .. "/templates/daily.md",
-- extension = ".md",
-- image_link_style = "markdown",
-- plug_into_calendar = true,
-- })
-- vim.keymap.set('n', '<leader>zn', tele.new_note, options)
-- vim.keymap.set('n', '<leader>zT', tele.goto_today, options)
-- vim.keymap.set('n', '<leader>zt', function()
-- local line = vim.api.nvim_get_current_line()
-- local nline = os.date("## %H:%M ")
-- vim.api.nvim_command(":normal G2o")
-- vim.api.nvim_set_current_line(nline)
-- vim.api.nvim_command(":normal o")
-- end)
-- vim.keymap.set('n', '<leader>zs', tele.search_notes, options)
-- vim.keymap.set('n', '<leader>zg', tele.follow_link, options)
-- vim.keymap.set('n', '<leader>zp', tele.panel, options)
-- vim.keymap.set('n', '<leader>zc', tele.show_calendar, options)
-- vim.keymap.set('n', '<leader>zo', tele.toggle_todo, options)

6
nvim/after/plugin/treesitter.lua

@ -1,11 +1,7 @@
require("nvim-treesitter.configs").setup({
ensure_installed = { "python", "rust" },
ensure_installed = { "python", "rust", "cpp" },
sync_install = false,
highlight = {
enable = true,
}
})
require("treesitter-context").setup({
mode = "topline",
})

24
nvim/lua/packager.lua

@ -1,10 +1,14 @@
return require("packer").startup(function(use)
-- this plugin
use("wbthomason/packer.nvim")
-- telescope opens a window over code for file dialogs
use({"nvim-telescope/telescope.nvim",
tag = '0.1.1',
requires = { { "nvim-lua/plenary.nvim" } },
})
-- lsp support
use("neovim/nvim-lspconfig")
-- use("folke/tokyonight.nvim")
@ -12,26 +16,26 @@ return require("packer").startup(function(use)
-- use("Shatur/neovim-ayu")
use("haishanh/night-owl.vim")
-- better color+syntax
use("nvim-treesitter/nvim-treesitter", {
run = ":TSUpdate"
})
use("nvim-treesitter/nvim-treesitter-context")
-- better statusline
use("nvim-lualine/lualine.nvim")
-- auto-add the closing bracket/parenthesis/quote/etc.
use("windwp/nvim-autopairs")
-- comment lines
use("tpope/vim-commentary")
-- use("renerocksai/telekasten.nvim")
-- use("renerocksai/calendar-vim")
-- syntax for Pest files
use("pest-parser/pest.vim")
-- use("Vimjas/vim-python-pep8-indent")
use({
"phaazon/mind.nvim",
branch = "v2.2",
requires = { { "nvim-lua/plenary.nvim" } }
})
-- editorconfig support
use("gpanders/editorconfig.nvim")
use("pest-parser/pest.vim")
-- Git support
use("tpope/vim-fugitive")
end)

2
nvim/lua/set.lua

@ -11,3 +11,5 @@ vim.opt.scrolloff = 2 -- number of lines to always have around cursor
vim.opt.splitright = true -- vertical splits open on the right
vim.opt.splitbelow = true -- horizontal splits open on the bottom
vim.g.mapleader = ' ' -- space is the leader character
vim.g.editorconfig = true -- enable editorconfig

3
starship/starship.toml

@ -29,3 +29,6 @@ style_user = "bold green"
[python]
format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style) '
[gcloud]
disabled = true

Loading…
Cancel
Save