diff --git a/nvim/after/plugin/colors.lua b/nvim/after/plugin/colors.lua index 8545ec1..f07cd32 100644 --- a/nvim/after/plugin/colors.lua +++ b/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") diff --git a/nvim/after/plugin/line.lua b/nvim/after/plugin/line.lua index 11f5734..06e57af 100644 --- a/nvim/after/plugin/line.lua +++ b/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 = {}, diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua index 2cc38cf..7ec9925 100644 --- a/nvim/after/plugin/lsp.lua +++ b/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', 'lua vim.lsp.buf.declaration()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.rename()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ga', 'lua vim.lsp.buf.code_action()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'v', 'ga', 'lua vim.lsp.buf.code_action()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.format({async = true})', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ge', 'lua vim.diagnostic.open_float()', opts) - vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gn', 'lua vim.diagnostic.goto_next()', opts) +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by + 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! * ]] - vim.api.nvim_command [[autocmd BufWritePre 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', '', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, 'ga', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', '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 - } -end + 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" }, +} diff --git a/nvim/after/plugin/mindnvim.lua b/nvim/after/plugin/mindnvim.lua deleted file mode 100644 index 01f1eda..0000000 --- a/nvim/after/plugin/mindnvim.lua +++ /dev/null @@ -1,6 +0,0 @@ -require("mind").setup({ - persistence = { - state_path = "~/Documents/Mind/main.json", - data_dir = "~/Documents/Mind/data", - } -}) diff --git a/nvim/after/plugin/telecasten.lua b/nvim/after/plugin/telecasten.lua deleted file mode 100644 index 1bed4aa..0000000 --- a/nvim/after/plugin/telecasten.lua +++ /dev/null @@ -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', 'zn', tele.new_note, options) --- vim.keymap.set('n', 'zT', tele.goto_today, options) --- vim.keymap.set('n', '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', 'zs', tele.search_notes, options) --- vim.keymap.set('n', 'zg', tele.follow_link, options) --- vim.keymap.set('n', 'zp', tele.panel, options) --- vim.keymap.set('n', 'zc', tele.show_calendar, options) --- vim.keymap.set('n', 'zo', tele.toggle_todo, options) diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua index 8653a3b..9d51127 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/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", -}) diff --git a/nvim/lua/packager.lua b/nvim/lua/packager.lua index 97386b9..05f4dba 100644 --- a/nvim/lua/packager.lua +++ b/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) diff --git a/nvim/lua/set.lua b/nvim/lua/set.lua index 3c25551..82d511e 100644 --- a/nvim/lua/set.lua +++ b/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 diff --git a/starship/starship.toml b/starship/starship.toml index 5116cf8..78e83cb 100644 --- a/starship/starship.toml +++ b/starship/starship.toml @@ -29,3 +29,6 @@ style_user = "bold green" [python] format = 'via [${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style) ' + +[gcloud] +disabled = true