diff --git a/ftplugin/java.lua b/ftplugin/java.lua deleted file mode 100644 index d2abac8..0000000 --- a/ftplugin/java.lua +++ /dev/null @@ -1,5 +0,0 @@ -local config = { - cmd = { os.getenv('HOME') .. '/.local/share/java/jdtls/bin/jdtls' }, - root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw' }, { upward = true })[1]), -} -require('jdtls').start_or_attach(config) diff --git a/init.lua b/init.lua index 7861bed..0cf3fbb 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,14 @@ -require("config.set") -require("config.remap") -require("config.lazy") +vim.lsp.enable( { "luals" }) + +vim.api.nvim_create_autocmd('LspAttach', { + callback = function(ev) + local client = vim.lsp.get_client_by_id(ev.data.client_id) + if client:supports_method('textDocument/completion') then + vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) + end + end, +}) + +vim.cmd("set completeopt+=noselect") +vim.o.winborder='rounded' + diff --git a/lsp/luals.lua b/lsp/luals.lua new file mode 100644 index 0000000..92e6ffb --- /dev/null +++ b/lsp/luals.lua @@ -0,0 +1,5 @@ +return { + cmd = { "lua-language-server" }, + root_markers = { ".luarc.json" }, + filetypes = { "lua" }, +} diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua deleted file mode 100644 index f5ee74c..0000000 --- a/lua/config/lazy.lua +++ /dev/null @@ -1,35 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, -}) diff --git a/lua/config/remap.lua b/lua/config/remap.lua deleted file mode 100644 index b760350..0000000 --- a/lua/config/remap.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.mapleader = " " -vim.keymap.set("n", "pv", vim.cmd.Ex) diff --git a/lua/config/set.lua b/lua/config/set.lua deleted file mode 100644 index 2293a7d..0000000 --- a/lua/config/set.lua +++ /dev/null @@ -1,46 +0,0 @@ -vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - group = vim.api.nvim_create_augroup("float_diagnostic_cursor", { clear = true }), - callback = function () - vim.diagnostic.open_float(nil, {focus=false, scope="cursor"}) - end -}) - -vim.opt.shell="zsh" -vim.opt.fileformat="unix" -vim.opt.fileformats="unix" -vim.opt.cmdheight = 0 -vim.opt.guicursor = "" -vim.opt.mouse = "" - -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true - -vim.opt.smartindent = true - -vim.opt.wrap = false - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true - -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.termguicolors = true -vim.opt.scrolloff = 8 -vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") - -vim.opt.updatetime = 50 - -vim.opt.colorcolumn = "80" - -vim.g.c_syntax_for_h = 1 -vim.g.mapleader = " " - diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua deleted file mode 100644 index bfba5f6..0000000 --- a/lua/plugins/lsp.lua +++ /dev/null @@ -1,76 +0,0 @@ -return { - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, - { "mfussenegger/nvim-jdtls" }, - { - "neovim/nvim-lspconfig", - config = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup {} - lspconfig.ccls.setup {} - lspconfig.basedpyright.setup { - settings = { - basedpyright = { - analysis = { - typeCheckingMode = "basic", - inlayHints = { callArgumentNames = true } - } - } - } - } - lspconfig.yamlls.setup {} - end, - }, - { - "VonHeikemen/lsp-zero.nvim", - dependencies = { - "neovim/nvim-lspconfig", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp" - }, - config = function() - vim.opt.signcolumn = 'yes' - - local lspconfig_defaults = require('lspconfig').util.default_config - lspconfig_defaults.capabilities = vim.tbl_deep_extend( - 'force', - lspconfig_defaults.capabilities, - require('cmp_nvim_lsp').default_capabilities() - ) - - vim.api.nvim_create_autocmd('LspAttach', { - desc = 'LSP actions', - callback = function(event) - local opts = { buffer = event.buf } - - vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()', opts) - vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - vim.keymap.set('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - vim.keymap.set('n', 'go', 'lua vim.lsp.buf.type_definition()', opts) - vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts) - vim.keymap.set('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) - vim.keymap.set('n', '', 'lua vim.lsp.buf.rename()', opts) - vim.keymap.set({ 'n', 'x' }, '', 'lua vim.lsp.buf.format({async = true})', opts) - vim.keymap.set('n', '', 'lua vim.lsp.buf.code_action()', opts) - end, - }) - - local lspconfig = require('lspconfig') - lspconfig.lua_ls.setup{} - - local cmp = require('cmp') - - cmp.setup({ - sources = { - { name = 'nvim_lsp' }, - }, - snippet = { - expand = function(args) - vim.snippet.expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({}), - }) - end, - } -} diff --git a/lua/plugins/util.lua b/lua/plugins/util.lua deleted file mode 100644 index a08737e..0000000 --- a/lua/plugins/util.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - { - "theprimeagen/harpoon", - config = function() - local mark = require("harpoon.mark") - local ui = require("harpoon.ui") - - vim.keymap.set("n", "a", mark.add_file) - vim.keymap.set("n", "", ui.toggle_quick_menu) - - vim.keymap.set("n", "", function() ui.nav_file(1) end) - vim.keymap.set("n", "", function() ui.nav_file(2) end) - vim.keymap.set("n", "", function() ui.nav_file(3) end) - vim.keymap.set("n", "", function() ui.nav_file(4) end) - end, - }, - { - "mbbill/undotree", - config = function() - vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) - end, - }, - { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", vim.cmd.Git) - end, - }, - { - "nvim-telescope/telescope.nvim", - dependencies = {"nvim-lua/plenary.nvim"}, - config = function() - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'pf', builtin.find_files, {}) - vim.keymap.set('n', '', builtin.git_files, {}) - vim.keymap.set('n', 'ps', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }); - end) - end, - } -} diff --git a/lua/plugins/visual.lua b/lua/plugins/visual.lua deleted file mode 100644 index d096778..0000000 --- a/lua/plugins/visual.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - "oxfist/night-owl.nvim", - lazy = false, -- make sure we load this during startup if it is your main colorscheme - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - -- load the colorscheme here - require("night-owl").setup() - vim.cmd.colorscheme("night-owl") - end, - }, - { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - lazy = false, - config = function() - require("lualine").setup() - end, - } -}