aboutsummaryrefslogtreecommitdiff
path: root/Common
diff options
context:
space:
mode:
authorjakob.stendahl <jakob.stendahl@infomedia.dk>2024-01-13 13:21:31 +0100
committerjakob.stendahl <jakob.stendahl@infomedia.dk>2024-01-13 13:21:31 +0100
commitb9513f21ae630ffcb93d68c21eeb70b5eebe74ae (patch)
tree1f67963996cc1dea426f650bf94f22a0843d5f88 /Common
parentabbbe7a4d3062ea2df0dd263528d824b7e4363a3 (diff)
downloaddotfiles-b9513f21ae630ffcb93d68c21eeb70b5eebe74ae.tar.gz
dotfiles-b9513f21ae630ffcb93d68c21eeb70b5eebe74ae.zip
Simplify nvim xp
Diffstat (limited to 'Common')
-rwxr-xr-xCommon/nvim/lua/basic.lua4
-rwxr-xr-xCommon/nvim/lua/helper_functions.lua10
-rwxr-xr-xCommon/nvim/lua/plugins.lua17
3 files changed, 18 insertions, 13 deletions
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', '<leader>cd', ':cd %:p:h<cr>:pwd<cr', silentnoremap)
vim.opt.switchbuf = 'useopen,usetab,newtab'
-- Always show tabbar
-vim.opt.stal = 2
+vim.opt.stal = 1
-- Return to last edit position when opening files (You want this!)
vim.cmd [[
diff --git a/Common/nvim/lua/helper_functions.lua b/Common/nvim/lua/helper_functions.lua
index 1b9ac50..1f57a09 100755
--- a/Common/nvim/lua/helper_functions.lua
+++ b/Common/nvim/lua/helper_functions.lua
@@ -46,7 +46,7 @@ vim.api.nvim_create_user_command('JoinLinesBT', JoinLinesBT, {bang=false, desc='
vim.keymap.set('n', '<Leader>wt', [[:%s/\s\+$//e<cr>]])
-- 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', '<leader>jq', FormatJson, { noremap = true, silent = true })
-vim.keymap.set('v', '<leader>jq', ':FormatJson<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>jq', JsonFormat, { noremap = true, silent = true })
+vim.keymap.set('v', '<leader>jq', ':JsonFormat<CR>', { 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 = {}