diff --git a/.gitmodules b/.gitmodules index 69f25f5..97dac54 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "nvim/pack/plugins/start/nvim-treesitter"] path = nvim/pack/plugins/start/nvim-treesitter url = https://github.com/nvim-treesitter/nvim-treesitter.git +[submodule "nvim/pack/plugins/start/lualine.nvim"] + path = nvim/pack/plugins/start/lualine.nvim + url = https://github.com/nvim-lualine/lualine.nvim.git diff --git a/nvim/init.lua b/nvim/init.lua index 3dd213e..3a946d2 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,9 +1,3 @@ -local nvim_lsp = require('lspconfig') -local saga = require('lspsaga') - --- commands that don't exist in lua yet -vim.cmd [[ -]] -- general configuration vim.opt.background = 'dark' -- the theme background is dark @@ -19,6 +13,11 @@ 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 +-- commands that don't exist in lua yet +vim.cmd [[ + color molokai +]] + -- Keybind: use '-' to open the file explorer vim.api.nvim_set_keymap('n', '-', ':Ex', { noremap=true, silent=true }) @@ -26,15 +25,17 @@ vim.api.nvim_set_keymap('n', '-', ':Ex', { noremap=true, silent=true }) vim.g['rainbow_active'] = true -- lsp saga improves the display of LSP information +local saga = require('lspsaga') saga.init_lsp_saga { - error_sign = '', - warn_sign = '', - hint_sign = '', - infor_sign = '', + error_sign = '>', + warn_sign = '#', + hint_sign = '!', + infor_sign = '?', border_style = "round", } -- lsp configuration +local nvim_lsp = require('lspconfig') local on_attach = function(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) @@ -56,11 +57,11 @@ end -- attach the keymaps -- lsp servers/languages configuration -require 'lspconfig'.rust_analyzer.setup { +nvim_lsp.rust_analyzer.setup { on_attach = on_attach } -require 'lspconfig'.pyright.setup { +nvim_lsp.pyright.setup { on_attach = on_attach } @@ -72,3 +73,41 @@ require 'nvim-treesitter.configs'.setup { enable = true, }, } + +-- lualine (better statusline) +require 'lualine'.setup { + options = { + icons_enabled = true, + -- theme = 'ayu_dark', + theme = 'ayu_mirage', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = {}, + always_divide_middle = true, + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = { + lualine_a = {}, + lualine_b = {'filename'}, + lualine_c = {}, + lualine_x = {}, + lualine_y = {}, + lualine_z = {'tabs'} + }, + extensions = {} +} diff --git a/nvim/pack/plugins/start/lualine.nvim b/nvim/pack/plugins/start/lualine.nvim new file mode 160000 index 0000000..70691ae --- /dev/null +++ b/nvim/pack/plugins/start/lualine.nvim @@ -0,0 +1 @@ +Subproject commit 70691ae350fdbe1f15758e3b8e2973742a7967a9