diff --git a/init.lua b/init.lua index 549f746..32285d9 100644 --- a/init.lua +++ b/init.lua @@ -1,14 +1,8 @@ -- https://learnxinyminutes.com/docs/lua/ --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Install package manager --- https://github.com/folke/lazy.nvim --- `:help lazy.nvim.txt` for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' if not vim.loop.fs_stat(lazypath) then vim.fn.system { @@ -22,23 +16,12 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) --- NOTE: Here is where you install your plugins. --- You can configure plugins using the `config` key. --- --- You can also configure plugins after the setup call, --- as they will be available in your neovim runtime. require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration - -- Git related plugins 'tpope/vim-fugitive', 'tpope/vim-rhubarb', - -- Detect tabstop and shiftwidth automatically 'tpope/vim-sleuth', - - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. { -- LSP Configuration & Plugins 'neovim/nvim-lspconfig', @@ -47,8 +30,6 @@ require('lazy').setup({ { 'williamboman/mason.nvim', config = true }, 'williamboman/mason-lspconfig.nvim', - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', tag = 'legacy', @@ -60,7 +41,6 @@ require('lazy').setup({ }, }, - -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', }, }, @@ -121,13 +101,8 @@ require('lazy').setup({ -- Fuzzy Finder (files, lsp, etc) { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } }, - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. { 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. build = 'make', cond = function() return vim.fn.executable 'make' == 1 @@ -143,25 +118,12 @@ require('lazy').setup({ build = ':TSUpdate', }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. require 'kickstart.plugins.autoformat', require 'kickstart.plugins.debug', - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins { import = 'custom.plugins' }, }, {}) --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! - -- Set highlight on search vim.o.hlsearch = false @@ -172,7 +134,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' @@ -242,7 +203,7 @@ vim.keymap.set('n', '', require('telescope.builtin').buffers, { d vim.keymap.set('n', '/', function() -- You can pass additional configuration to telescope to change theme, layout, etc. require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, + winblend = 0, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) @@ -258,7 +219,7 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'java' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -329,12 +290,6 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. local nmap = function(keys, func, desc) if desc then desc = 'LSP: ' .. desc @@ -355,7 +310,7 @@ local on_attach = function(_, bufnr) -- See `:help K` for why this keymap nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') -- Lesser used LSP functionality nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -371,14 +326,6 @@ local on_attach = function(_, bufnr) end, { desc = 'Format current buffer with LSP' }) end --- 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 = {}, @@ -420,7 +367,7 @@ mason_lspconfig.setup_handlers { } end } - +-- this is for my personal config, i cant bother seeing every TJ's default and changing it to my own require("jabuxas") -- The line beneath this is called `modeline`. See `:help modeline`