feat: add tabline, filetree, autopairs
This commit is contained in:
parent
d891f4ac5a
commit
4b150dbc0d
26
init.lua
26
init.lua
|
@ -147,24 +147,10 @@ require('lazy').setup({
|
||||||
'navarasu/onedark.nvim',
|
'navarasu/onedark.nvim',
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd.colorscheme 'onedark'
|
vim.cmd.colorscheme 'onedark_dark'
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
-- Set lualine as statusline
|
|
||||||
'nvim-lualine/lualine.nvim',
|
|
||||||
-- See `:help lualine.txt`
|
|
||||||
opts = {
|
|
||||||
options = {
|
|
||||||
icons_enabled = false,
|
|
||||||
theme = 'onedark',
|
|
||||||
component_separators = '|',
|
|
||||||
section_separators = '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
-- Add indentation guides even on blank lines
|
-- Add indentation guides even on blank lines
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
|
@ -221,7 +207,7 @@ require('lazy').setup({
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
--
|
--
|
||||||
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
|
@ -272,8 +258,8 @@ vim.o.termguicolors = true
|
||||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
|
|
||||||
-- Remap for dealing with word wrap
|
-- Remap for dealing with word wrap
|
||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
-- vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
-- vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
-- [[ Highlight on yank ]]
|
-- [[ Highlight on yank ]]
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.highlight.on_yank()`
|
||||||
|
@ -450,8 +436,8 @@ local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
-- tsserver = {},
|
tsserver = {},
|
||||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
-- Optional dependency
|
||||||
|
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||||
|
config = function()
|
||||||
|
require("nvim-autopairs").setup {}
|
||||||
|
-- If you want to automatically add `(` after selecting a function or method
|
||||||
|
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||||
|
local cmp = require('cmp')
|
||||||
|
cmp.event:on(
|
||||||
|
'confirm_done',
|
||||||
|
cmp_autopairs.on_confirm_done()
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
return {
|
||||||
|
"nvim-web-devicons",
|
||||||
|
config = function ()
|
||||||
|
require 'nvim-web-devicons'.setup {
|
||||||
|
override = {
|
||||||
|
zsh = {
|
||||||
|
icon = "",
|
||||||
|
color = "#428850",
|
||||||
|
cterm_color = "65",
|
||||||
|
name = "Zsh"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
color_icons = true,
|
||||||
|
default = true,
|
||||||
|
strict = true,
|
||||||
|
override_by_filename = {
|
||||||
|
[".gitignore"] = {
|
||||||
|
icon = "",
|
||||||
|
color = "#f1502f",
|
||||||
|
name = "Gitignore"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
override_by_extension = {
|
||||||
|
["log"] = {
|
||||||
|
icon = "",
|
||||||
|
color = "#81e043",
|
||||||
|
name = "Log"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
config = function ()
|
||||||
|
require('neo-tree').setup {
|
||||||
|
window = {
|
||||||
|
width = 30,
|
||||||
|
mappings = {
|
||||||
|
["o"] = "open",
|
||||||
|
["sv"] = "open_vsplit",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vim.keymap.set('n', '<leader>sn', ':Neotree filesystem reveal float git_status<CR>', { noremap = true, silent = true })
|
||||||
|
end,
|
||||||
|
}
|
|
@ -2,4 +2,41 @@
|
||||||
-- I promise not to create any merge conflicts in this directory :)
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
--
|
--
|
||||||
-- See the kickstart.nvim README for more information
|
-- See the kickstart.nvim README for more information
|
||||||
return {}
|
return {
|
||||||
|
"olimorris/onedarkpro.nvim",
|
||||||
|
config = function ()
|
||||||
|
local keymap = vim.keymap
|
||||||
|
|
||||||
|
-- select all
|
||||||
|
keymap.set('n', '<C-a>', 'gg<S-v>G')
|
||||||
|
|
||||||
|
-- always center
|
||||||
|
keymap.set('n', 'j', 'jzz', { noremap = false, silent = true })
|
||||||
|
keymap.set('n', 'k', 'kzz', { noremap = false, silent = true })
|
||||||
|
|
||||||
|
-- escape insert mode
|
||||||
|
keymap.set('i', 'jj', '<ESC>', { noremap = true, silent = true })
|
||||||
|
|
||||||
|
-- split remaps
|
||||||
|
keymap.set('n', 'ss', ':split<Return><C-w>w')
|
||||||
|
keymap.set('n', 'sv', ':vsplit<Return><C-w>w')
|
||||||
|
keymap.set('n', '<Space>', '<C-w>w')
|
||||||
|
keymap.set('', 'sh', '<C-w>h')
|
||||||
|
keymap.set('', 'sk', '<C-w>k')
|
||||||
|
keymap.set('', 'sj', '<C-w>j')
|
||||||
|
keymap.set('', 'sl', '<C-w>l')
|
||||||
|
|
||||||
|
-- Resize window
|
||||||
|
keymap.set('n', 's,', '<C-w><')
|
||||||
|
keymap.set('n', 's.', '<C-w>>')
|
||||||
|
keymap.set('n', 's=', '<C-w>+')
|
||||||
|
keymap.set('n', 's-', '<C-w>-')
|
||||||
|
|
||||||
|
-- quit
|
||||||
|
keymap.set('n', 'q', ':q<CR>', { silent = true })
|
||||||
|
keymap.set('n', 'Q', ':q!<CR>', { silent = true })
|
||||||
|
|
||||||
|
-- save
|
||||||
|
keymap.set('n', 'sw', ':w<CR>', { silent = true })
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
local custom_onedark = require 'lualine.themes.onedark_dark'
|
||||||
|
custom_onedark.normal.c.bg = '#000000'
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- Set lualine as statusline
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
-- See `:help lualine.txt`
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = custom_onedark,
|
||||||
|
section_separators = { left = '', right = '' },
|
||||||
|
component_separators = { left = '', right = '' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
return {
|
||||||
|
"kdheepak/tabline.nvim",
|
||||||
|
config = function()
|
||||||
|
require 'tabline'.setup {
|
||||||
|
enable = true,
|
||||||
|
options = {
|
||||||
|
section_separators = { '', '' },
|
||||||
|
component_separators = { '', '' },
|
||||||
|
max_bufferline_percent = 66, -- set to nil by default, and it uses vim.o.columns * 2/3
|
||||||
|
show_tabs_always = false, -- this shows tabs only when there are more than one tab or if the first tab is named
|
||||||
|
show_devicons = true, -- this shows devicons in buffer section
|
||||||
|
show_bufnr = false, -- this appends [bufnr] to buffer section,
|
||||||
|
show_filename_only = false, -- shows base filename only instead of relative path in filename
|
||||||
|
modified_icon = "+ ", -- change the default modified icon
|
||||||
|
modified_italic = false, -- set to true by default; this determines whether the filename turns italic if modified
|
||||||
|
show_tabs_only = false, -- this shows only tabs instead of tabs + buffers
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<Tab>', '<Cmd>TablineBufferNext<CR>', {})
|
||||||
|
vim.keymap.set('n', '<S-Tab>', '<Cmd>TablineBufferPrev<CR>', {})
|
||||||
|
vim.keymap.set('n', ';x', ':bp<bar>sp<bar>bn<bar>bd<CR><CR>', { noremap = true, silent = true })
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Reference in New Issue