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.background = "dark" -- the theme background is dark
vim.opt.termguicolors = true 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") vim.cmd("colorscheme night-owl")

4
nvim/after/plugin/line.lua

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

67
nvim/after/plugin/lsp.lua

@ -1,33 +1,42 @@
local attachment = function(client, bufnr) vim.api.nvim_create_autocmd('LspAttach', {
local opts = { noremap=true, silent=true } group = vim.api.nvim_create_augroup('UserLspConfig', {}),
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) callback = function(ev)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) -- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
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)
if client.resolved_capabilities.document_formatting then -- Buffer local mappings.
vim.api.nvim_command [[augroup Format]] -- See `:help vim.lsp.*` for documentation on any of the below functions
vim.api.nvim_command [[autocmd! * <buffer>]] local opts = { buffer = ev.buf }
vim.api.nvim_command [[autocmd BufWritePre <buffer> lua vim.lsp.buf.format({async = false})]] vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.api.nvim_command [[augroup END]] vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
end vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
end 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' } vim.keymap.set('n', 'ge', vim.diagnostic.open_float)
for _, lsp in pairs(servers) do vim.keymap.set('n', 'gp', vim.diagnostic.goto_prev)
require('lspconfig')[lsp].setup { vim.keymap.set('n', 'gn', vim.diagnostic.goto_next)
on_attach = attachment 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({ require("nvim-treesitter.configs").setup({
ensure_installed = { "python", "rust" }, ensure_installed = { "python", "rust", "cpp" },
sync_install = false, sync_install = false,
highlight = { highlight = {
enable = true, enable = true,
} }
}) })
require("treesitter-context").setup({
mode = "topline",
})

24
nvim/lua/packager.lua

@ -1,10 +1,14 @@
return require("packer").startup(function(use) return require("packer").startup(function(use)
-- this plugin
use("wbthomason/packer.nvim") use("wbthomason/packer.nvim")
-- telescope opens a window over code for file dialogs
use({"nvim-telescope/telescope.nvim", use({"nvim-telescope/telescope.nvim",
tag = '0.1.1',
requires = { { "nvim-lua/plenary.nvim" } }, requires = { { "nvim-lua/plenary.nvim" } },
}) })
-- lsp support
use("neovim/nvim-lspconfig") use("neovim/nvim-lspconfig")
-- use("folke/tokyonight.nvim") -- use("folke/tokyonight.nvim")
@ -12,26 +16,26 @@ return require("packer").startup(function(use)
-- use("Shatur/neovim-ayu") -- use("Shatur/neovim-ayu")
use("haishanh/night-owl.vim") use("haishanh/night-owl.vim")
-- better color+syntax
use("nvim-treesitter/nvim-treesitter", { use("nvim-treesitter/nvim-treesitter", {
run = ":TSUpdate" run = ":TSUpdate"
}) })
use("nvim-treesitter/nvim-treesitter-context")
-- better statusline
use("nvim-lualine/lualine.nvim") use("nvim-lualine/lualine.nvim")
-- auto-add the closing bracket/parenthesis/quote/etc.
use("windwp/nvim-autopairs") use("windwp/nvim-autopairs")
-- comment lines
use("tpope/vim-commentary") use("tpope/vim-commentary")
-- use("renerocksai/telekasten.nvim") -- syntax for Pest files
-- use("renerocksai/calendar-vim") use("pest-parser/pest.vim")
-- use("Vimjas/vim-python-pep8-indent") -- editorconfig support
use({ use("gpanders/editorconfig.nvim")
"phaazon/mind.nvim",
branch = "v2.2",
requires = { { "nvim-lua/plenary.nvim" } }
})
use("pest-parser/pest.vim") -- Git support
use("tpope/vim-fugitive")
end) 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.splitright = true -- vertical splits open on the right
vim.opt.splitbelow = true -- horizontal splits open on the bottom vim.opt.splitbelow = true -- horizontal splits open on the bottom
vim.g.mapleader = ' ' -- space is the leader character 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] [python]
format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style) ' format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style) '
[gcloud]
disabled = true

Loading…
Cancel
Save