Skip to content

Commit 9572bf0

Browse files
committed
Refactor theme and status line into their own file
1 parent 88557a6 commit 9572bf0

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

lua/kickstart/plugins/autoformat.lua

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
return {
77
'neovim/nvim-lspconfig',
8+
89
config = function()
910
-- Switch for controlling whether you want autoformatting.
1011
-- Use :KickstartFormatToggle to toggle autoformatting on or off
@@ -28,11 +29,9 @@ return {
2829
return _augroups[client.id]
2930
end
3031

31-
-- Whenever an LSP attaches to a buffer, we will run this function.
32-
--
33-
-- See `:help LspAttach` for more information about this autocmd event.
3432
vim.api.nvim_create_autocmd('LspAttach', {
3533
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
34+
3635
-- This is where we attach the autoformatting for reasonable clients
3736
callback = function(args)
3837
local client_id = args.data.client_id
@@ -50,8 +49,6 @@ return {
5049
return
5150
end
5251

53-
-- Create an autocmd that will run *before* we save the buffer.
54-
-- Run the formatting command for the LSP that has just attached.
5552
vim.api.nvim_create_autocmd('BufWritePre', {
5653
group = get_augroup(client),
5754
buffer = bufnr,
@@ -60,12 +57,7 @@ return {
6057
return
6158
end
6259

63-
vim.lsp.buf.format {
64-
async = false,
65-
filter = function(c)
66-
return c.id == client.id
67-
end,
68-
}
60+
vim.lsp.buf.format { async = false }
6961
end,
7062
})
7163
end,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
return {
2+
-- Set lualine as statusline
3+
'nvim-lualine/lualine.nvim',
4+
-- See `:help lualine.txt`
5+
opts = {
6+
options = {
7+
icons_enabled = false,
8+
theme = 'tokyonight',
9+
component_separators = '|',
10+
section_separators = '',
11+
},
12+
},
13+
}
14+

lua/kickstart/plugins/theme.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
return {
2+
"folke/tokyonight.nvim",
3+
lazy = false,
4+
priority = 1000,
5+
opts = {},
6+
config = function()
7+
vim.cmd.colorscheme 'tokyonight-storm'
8+
end,
9+
}
10+

0 commit comments

Comments
 (0)