From b9513f21ae630ffcb93d68c21eeb70b5eebe74ae Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Sat, 13 Jan 2024 13:21:31 +0100 Subject: Simplify nvim xp --- Common/nvim/lua/basic.lua | 4 ++-- Common/nvim/lua/helper_functions.lua | 10 +++++----- Common/nvim/lua/plugins.lua | 17 +++++++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) (limited to 'Common/nvim') diff --git a/Common/nvim/lua/basic.lua b/Common/nvim/lua/basic.lua index d1b0901..59e8f68 100755 --- a/Common/nvim/lua/basic.lua +++ b/Common/nvim/lua/basic.lua @@ -5,7 +5,7 @@ General -- Lines of history vim.opt.history = 500 -- Line numbers -vim.opt.nu = true +vim.opt.nu = false -- Autoread when file is changed outside vim vim.opt.autoread = true @@ -191,7 +191,7 @@ map('n', 'cd', ':cd %:p:h:pwdwt', [[:%s/\s\+$//e]]) -- Quick json formatting using jq -function FormatJson(start_line, end_line) +function JsonFormat(start_line, end_line) if start_line == nil or end_line == nil then if vim.fn.mode() == 'v' then start_line, _, end_line, _ = unpack(vim.fn.getpos("'<"), 2, 5) @@ -61,11 +61,11 @@ function FormatJson(start_line, end_line) handle:close() vim.api.nvim_buf_set_lines(0, start_line - 1, end_line, false, vim.fn.split(result, "\n")) end -vim.api.nvim_create_user_command('FormatJson', function(opts) - FormatJson(opts.line1, opts.line2) +vim.api.nvim_create_user_command('JsonFormat', function(opts) + JsonFormat(opts.line1, opts.line2) end, {range = true, desc = 'Format JSON'}) -vim.keymap.set('n', 'jq', FormatJson, { noremap = true, silent = true }) -vim.keymap.set('v', 'jq', ':FormatJson', { noremap = true, silent = true }) +vim.keymap.set('n', 'jq', JsonFormat, { noremap = true, silent = true }) +vim.keymap.set('v', 'jq', ':JsonFormat', { noremap = true, silent = true }) function English() vim.opt.spell = true diff --git a/Common/nvim/lua/plugins.lua b/Common/nvim/lua/plugins.lua index 9669d2c..e4ba713 100755 --- a/Common/nvim/lua/plugins.lua +++ b/Common/nvim/lua/plugins.lua @@ -34,16 +34,19 @@ return require('packer').startup(function(use) requires = { 'kyazdani42/nvim-web-devicons', opt = true }, config = function() require('lualine').setup { - options = { theme = 'onedark' }, + options = { + theme = 'Tomorrow', + component_separators = '', + section_separators = '' + }, sections = { + lualine_a = {'mode'}, lualine_x = {'filetype'}, lualine_y = {} }, - tabline = { - lualine_a = {'buffers'}, - lualine_b = {'branch'}, - lualine_z = {'tabs'} - } + -- tabline = { + -- lualine_z = {'tabs'} + -- } } end, } @@ -205,6 +208,8 @@ return require('packer').startup(function(use) use { 'mattn/calendar-vim', config = function() + vim.g.calendar_monday = 1 + vim.g.calendar_weeknm = 5 vim.api.nvim_create_autocmd("QuitPre", { callback = function() local invalid_win = {} -- cgit v1.2.3