diff --git a/init.lua b/init.lua index ea80148..2382fac 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,7 @@ require('packer_init') require('keybindings') --vim.opt.guicursor = " " -vim.opt.nu = true +vim.opt.nu = true vim.opt.relativenumber = true vim.opt.tabstop = 4 @@ -17,7 +17,7 @@ vim.opt.smartindent = true vim.opt.wrap = false require('nvim-treesitter.configs').setup { - ensure_installed = { "c", "cpp", "lua", "zig", "rust" }, + ensure_installed = { "c", "cpp", "lua", "zig", "go" }, sync_install = false, auto_install = false, highlight = { @@ -34,9 +34,14 @@ require('treesitter-context').setup { enable = true, max_lines = 0, min_window_height = 0, + patterns = { + zig = { + 'fn', + 'struct', + }, + }, } -require('nvim-autopairs').setup{ -} +require('nvim-autopairs').setup{} require('telescope').setup{ defaults = { }, diff --git a/lua/buildcmd.lua b/lua/buildcmd.lua index fd8e668..7c00ae8 100644 --- a/lua/buildcmd.lua +++ b/lua/buildcmd.lua @@ -17,8 +17,8 @@ function save_all_and_build() local opts = {} vim.api.nvim_exec('wa', opts) - - if not has_buffer() then + + if not has_buffer() then job_buffer = vim.api.nvim_create_buf(true, true) end local job_window = vim.fn.bufwinnr(job_buffer) diff --git a/lua/keybindings.lua b/lua/keybindings.lua index 4f2c5d8..e9ed9ab 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -37,8 +37,41 @@ end local lsp_flags = { debounce_text_changes = 150, --wtf is this } -require('lspconfig')['zls'].setup { +local lspconfig = require('lspconfig'); +lspconfig.zls.setup { on_attach = on_attach, - flags = lsp_flags + flags = lsp_flags, +} +lspconfig.gopls.setup{ + on_attach = on_attach, + flags = lsp_flags, +} +lspconfig.clangd.setup{ + on_attach = on_attach, + flags = lsp_flags, +} +-- honestly don't need this, telemetry is a big yikes. +lspconfig.sumneko_lua.setup{ + on_attach = on_attach, + flags = lsp_flags, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, } ---TODO: other languages I care about. diff --git a/lua/packer_init.lua b/lua/packer_init.lua index cb19347..0819c08 100644 --- a/lua/packer_init.lua +++ b/lua/packer_init.lua @@ -3,13 +3,16 @@ vim.cmd [[packadd packer.nvim]] return require('packer').startup(function(use) -- Packer can manage itself use 'wbthomason/packer.nvim' + -- themes use 'sainnhe/everforest' use 'sainnhe/sonokai' - use { 'nvim-treesitter/nvim-treesitter' } - use 'neovim/nvim-lspconfig' - use 'nvim-treesitter/nvim-treesitter-context' - use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = {{'nvim-lua/plenary.nvim'}} } - use { 'windwp/nvim-autopairs' } use { 'tomasr/molokai' } use 'morhetz/gruvbox' + -- Treesitter + use { 'nvim-treesitter/nvim-treesitter' } + use 'nvim-treesitter/nvim-treesitter-context' + -- Utils + use 'neovim/nvim-lspconfig' + use { 'nvim-telescope/telescope.nvim', tag = '0.1.0', requires = {{'nvim-lua/plenary.nvim'}} } + use { 'windwp/nvim-autopairs' } end) diff --git a/lua/statusline.lua b/lua/statusline.lua index 9d2b0b2..1f5cfae 100644 --- a/lua/statusline.lua +++ b/lua/statusline.lua @@ -88,7 +88,7 @@ local function lsp() if count["warnings"] ~= 0 then warnings = " %#LspDiagnosticsSignHint# " .. count["warnings"] end - + if count["hints"] ~= 0 then hints = " %#LspDiagnosticsSignHint# " .. count["hints"] end @@ -105,7 +105,7 @@ local function filetype() end local function lineinfo() - if vim.bo.filetype == "alpha" then + if vim.bo.filetype == "alpha" then return "" end return " %l:%c %P %"