🏷️ Update(lualine): Update lualine
also clean up code
This commit is contained in:
parent
828431ef70
commit
1cda15e20b
4
init.lua
4
init.lua
@ -1,6 +1,4 @@
|
|||||||
-- source options
|
-- source options and mappings
|
||||||
require('core')
|
require('core')
|
||||||
-- load mappings
|
|
||||||
require('mappings')
|
|
||||||
-- load plugins and its options
|
-- load plugins and its options
|
||||||
require('lazy-plugins')
|
require('lazy-plugins')
|
||||||
|
44
lua/core.lua
44
lua/core.lua
@ -1,25 +1,57 @@
|
|||||||
-- CORE SETTINGS
|
-- CORE SETTINGS
|
||||||
local o = vim.o
|
local o = vim.o
|
||||||
local global = vim.g
|
local global = vim.g
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
-- look and feel
|
-- look and feel
|
||||||
|
global.netrw_bufsettings = "noma nomod relativenumber nowrap ro nobl"
|
||||||
o.number = true
|
o.number = true
|
||||||
o.relativenumber = true
|
o.relativenumber = true
|
||||||
o.ruler = true
|
o.ruler = true
|
||||||
o.scrolloff = 10
|
o.scrolloff = 10
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
o.spell = true
|
o.spell = true
|
||||||
global.netrw_bufsettings = "noma nomod relativenumber nowrap ro nobl"
|
|
||||||
|
|
||||||
-- controlling
|
-- controlling
|
||||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
global.mapleader = ' '
|
||||||
o.autoindent = true
|
o.autoindent = true
|
||||||
o.ignorecase = true
|
o.ignorecase = true
|
||||||
o.smartcase = true
|
o.smartcase = true
|
||||||
o.smartindent = true
|
o.smartindent = true
|
||||||
|
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||||
|
|
||||||
-- leader settings
|
-- vscode
|
||||||
global.mapleader = ' '
|
if vim.g.vscode then
|
||||||
|
-- undo/REDO via vscode
|
||||||
|
map("n", "u", "<Cmd>call VSCodeNotify('undo')<CR>")
|
||||||
|
map("n", "<C-r>", "<Cmd>call VSCodeNotify('redo')<CR>")
|
||||||
|
map("n", "gf", "<Cmd>call VSCodeCall('editor.action.openLink')<CR>", { noremap = true })
|
||||||
|
end
|
||||||
|
|
||||||
-- env settings for plugins
|
-- generic mappings
|
||||||
global.tagbar_sort = 0
|
map('v', '<', '<gv', { noremap = true })
|
||||||
|
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('', '<A-h>', '<C-w>h')
|
||||||
|
map('', '<A-j>', '<C-w>j')
|
||||||
|
map('', '<A-k>', '<C-w>k')
|
||||||
|
map('', '<A-l>', '<C-w>l')
|
||||||
|
map('', '<A-H>', '<C-w>H')
|
||||||
|
map('', '<A-J>', '<C-w>J')
|
||||||
|
map('', '<A-K>', '<C-w>K')
|
||||||
|
map('', '<A-L>', '<C-w>L')
|
||||||
|
map('', '<M-S-.>', '<C-w>>')
|
||||||
|
map('', '<M-S-,>', '<C-w><')
|
||||||
|
map('', '<M-S-=>', '<C-w>+')
|
||||||
|
map('', '<M-->', '<C-w>-')
|
||||||
|
map('', '<A-T>', '<C-w>T')
|
||||||
|
|
||||||
|
-- undo to the last , . or !
|
||||||
|
map('i', ',', ',<c-g>u', { noremap = true })
|
||||||
|
map('i', '.', '.<c-g>u', { noremap = true })
|
||||||
|
map('i', '!', '!<c-g>u', { noremap = true })
|
||||||
|
map('i', '?', '?<c-g>u', { noremap = true })
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
local map = vim.keymap.set
|
|
||||||
|
|
||||||
-- vscode
|
|
||||||
if vim.g.vscode then
|
|
||||||
-- undo/REDO via vscode
|
|
||||||
map("n", "u", "<Cmd>call VSCodeNotify('undo')<CR>")
|
|
||||||
map("n", "<C-r>", "<Cmd>call VSCodeNotify('redo')<CR>")
|
|
||||||
map("n", "gf", "<Cmd>call VSCodeCall('editor.action.openLink')<CR>", { noremap = true })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- generic mappings
|
|
||||||
map('v', '<', '<gv', { noremap = true })
|
|
||||||
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('', '<A-h>', '<C-w>h')
|
|
||||||
map('', '<A-j>', '<C-w>j')
|
|
||||||
map('', '<A-k>', '<C-w>k')
|
|
||||||
map('', '<A-l>', '<C-w>l')
|
|
||||||
map('', '<A-H>', '<C-w>H')
|
|
||||||
map('', '<A-J>', '<C-w>J')
|
|
||||||
map('', '<A-K>', '<C-w>K')
|
|
||||||
map('', '<A-L>', '<C-w>L')
|
|
||||||
map('', '<M-S-.>', '<C-w>>')
|
|
||||||
map('', '<M-S-,>', '<C-w><')
|
|
||||||
map('', '<M-S-=>', '<C-w>+')
|
|
||||||
map('', '<M-->', '<C-w>-')
|
|
||||||
map('', '<A-T>', '<C-w>T')
|
|
||||||
|
|
||||||
-- undo to the last , . or !
|
|
||||||
map('i', ',', ',<c-g>u', { noremap = true })
|
|
||||||
map('i', '.', '.<c-g>u', { noremap = true })
|
|
||||||
map('i', '!', '!<c-g>u', { noremap = true })
|
|
||||||
map('i', '?', '?<c-g>u', { noremap = true })
|
|
@ -2,8 +2,8 @@ require 'lualine'.setup {
|
|||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = 'gruvbox',
|
theme = 'gruvbox',
|
||||||
component_separators = { '|', '|' },
|
component_separators = { left = "", right = "|" },
|
||||||
section_separators = { '', '' },
|
section_separators = "",
|
||||||
disabled_filetypes = {}
|
disabled_filetypes = {}
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
@ -12,10 +12,7 @@ require 'lualine'.setup {
|
|||||||
'branch',
|
'branch',
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{ 'filename', path = 1 },
|
||||||
'filename',
|
|
||||||
path = 1
|
|
||||||
},
|
|
||||||
'diff',
|
'diff',
|
||||||
},
|
},
|
||||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||||
|
Loading…
Reference in New Issue
Block a user