Browse Source

lualine with options

imac
Juni Kim 2 years ago
parent
commit
d3d36c6e51
  1. 52
      after/plugin/lualine.lua
  2. 5
      lua/junikim/options.lua
  3. 5
      lua/junikim/packer.lua
  4. 10
      lua/junikim/remap.lua

52
after/plugin/lualine.lua

@ -0,0 +1,52 @@
local function getWords()
return tostring(vim.fn.wordcount().words) .. " W"
end
require('lualine').setup {
options = {
icons_enabled = true,
--theme = 'auto',
theme = 'onedark',
--component_separators = { left = '', right = '' },
--component_separators = { left = '', right = '' },
--section_separators = { left = '', right = '' },
--section_separators = { left = '', right = '' },
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch', 'diff', 'diagnostics' },
lualine_c = { 'filename' },
lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_y = { getWords },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

5
lua/junikim/options.lua

@ -20,6 +20,11 @@ vim.opt.incsearch = true
vim.g.airline_theme = "base16_chalk"
vim.g.airline_powerline_fonts = 1
vim.opt.nu = true
vim.opt.rnu = true
vim.opt.scrolloff = 7
vim.cmd("filetype plugin indent on")
vim.cmd("filetype on")

5
lua/junikim/packer.lua

@ -19,7 +19,10 @@ return require('packer').startup(function(use)
)
use 'nvim-tree/nvim-web-devicons'
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
use 'vim-airline/vim-airline'
use {
'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
use 'vim-airline/vim-airline-themes'
use 'tpope/vim-fugitive'

10
lua/junikim/remap.lua

@ -22,10 +22,16 @@ map("i", "<A-i>", "ī")
map("i", "<A-o>", "ō")
map("i", "<A-u>", "ū")
map("n", "<F12>", ":w|:!texbld run compile")
map("n", "<F5>", ":w|:!./test.sh")
map("n", "<F12>", ":w|:!texbld run compile<CR>")
map("n", "<F5>", ":w|:!./test.sh<CR>")
-- hacks
vim.keymap.set("x", "<leader>p", [["_dP]])
vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
vim.keymap.set("n", "<leader>Y", [["+Y]])
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
vim.keymap.set("n", "<leader>X", "<cmd>!chmod -x %<CR>", { silent = true })
vim.keymap.set("n", "<leader>vc", "<cmd>e ~/.config/nvim<CR>");
vim.keymap.set("n", "<leader>vz", "<cmd>e ~/.zshrc<CR>");

Loading…
Cancel
Save