From 1cda15e20b214ae9ce60c1195140d76492f4d045 Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 30 Nov 2023 16:04:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Update(lualine):=20Upda?= =?UTF-8?q?te=20lualine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit also clean up code --- init.lua | 4 +--- lua/core.lua | 44 ++++++++++++++++++++++++++++++++------ lua/mappings.lua | 37 -------------------------------- lua/plugins/statusline.lua | 9 +++----- 4 files changed, 42 insertions(+), 52 deletions(-) delete mode 100644 lua/mappings.lua diff --git a/init.lua b/init.lua index 56be773..4c17004 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,4 @@ --- source options +-- source options and mappings require('core') --- load mappings -require('mappings') -- load plugins and its options require('lazy-plugins') diff --git a/lua/core.lua b/lua/core.lua index 1f2d2f7..cffc8be 100644 --- a/lua/core.lua +++ b/lua/core.lua @@ -1,25 +1,57 @@ -- CORE SETTINGS local o = vim.o local global = vim.g +local map = vim.keymap.set -- look and feel +global.netrw_bufsettings = "noma nomod relativenumber nowrap ro nobl" o.number = true o.relativenumber = true o.ruler = true o.scrolloff = 10 o.showmode = false o.spell = true -global.netrw_bufsettings = "noma nomod relativenumber nowrap ro nobl" -- controlling -vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } +global.mapleader = ' ' o.autoindent = true o.ignorecase = true o.smartcase = true o.smartindent = true +vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } --- leader settings -global.mapleader = ' ' +-- vscode +if vim.g.vscode then + -- undo/REDO via vscode + map("n", "u", "call VSCodeNotify('undo')") + map("n", "", "call VSCodeNotify('redo')") + map("n", "gf", "call VSCodeCall('editor.action.openLink')", { noremap = true }) +end --- env settings for plugins -global.tagbar_sort = 0 +-- generic mappings +map('v', '<', '', '>gv', { noremap = true }) +map('n', 'Y', 'y$', { noremap = true }) +map('n', 'n', 'nzzzv', { noremap = true }) +map('n', 'N', 'Nzzzv', { noremap = true }) + +-- Shortcutting split navigation +map('', '', 'h') +map('', '', 'j') +map('', '', 'k') +map('', '', 'l') +map('', '', 'H') +map('', '', 'J') +map('', '', 'K') +map('', '', 'L') +map('', '', '>') +map('', '', '<') +map('', '', '+') +map('', '', '-') +map('', '', 'T') + +-- undo to the last , . or ! +map('i', ',', ',u', { noremap = true }) +map('i', '.', '.u', { noremap = true }) +map('i', '!', '!u', { noremap = true }) +map('i', '?', '?u', { noremap = true }) diff --git a/lua/mappings.lua b/lua/mappings.lua deleted file mode 100644 index 033e582..0000000 --- a/lua/mappings.lua +++ /dev/null @@ -1,37 +0,0 @@ -local map = vim.keymap.set - --- vscode -if vim.g.vscode then - -- undo/REDO via vscode - map("n", "u", "call VSCodeNotify('undo')") - map("n", "", "call VSCodeNotify('redo')") - map("n", "gf", "call VSCodeCall('editor.action.openLink')", { noremap = true }) -end - --- generic mappings -map('v', '<', '', '>gv', { noremap = true }) -map('n', 'Y', 'y$', { noremap = true }) -map('n', 'n', 'nzzzv', { noremap = true }) -map('n', 'N', 'Nzzzv', { noremap = true }) - --- Shortcutting split navigation -map('', '', 'h') -map('', '', 'j') -map('', '', 'k') -map('', '', 'l') -map('', '', 'H') -map('', '', 'J') -map('', '', 'K') -map('', '', 'L') -map('', '', '>') -map('', '', '<') -map('', '', '+') -map('', '', '-') -map('', '', 'T') - --- undo to the last , . or ! -map('i', ',', ',u', { noremap = true }) -map('i', '.', '.u', { noremap = true }) -map('i', '!', '!u', { noremap = true }) -map('i', '?', '?u', { noremap = true }) diff --git a/lua/plugins/statusline.lua b/lua/plugins/statusline.lua index ea2c25e..3bb5b1a 100644 --- a/lua/plugins/statusline.lua +++ b/lua/plugins/statusline.lua @@ -2,8 +2,8 @@ require 'lualine'.setup { options = { icons_enabled = true, theme = 'gruvbox', - component_separators = { '|', '|' }, - section_separators = { '', '' }, + component_separators = { left = "", right = "|" }, + section_separators = "", disabled_filetypes = {} }, sections = { @@ -12,10 +12,7 @@ require 'lualine'.setup { 'branch', }, lualine_c = { - { - 'filename', - path = 1 - }, + { 'filename', path = 1 }, 'diff', }, lualine_x = { 'encoding', 'fileformat', 'filetype' },