initial commit for config
This commit is contained in:
parent
a22976111e
commit
80c2d1d5d8
3 changed files with 476 additions and 25 deletions
52
init.lua
52
init.lua
|
|
@ -157,6 +157,13 @@ vim.opt.cursorline = true
|
|||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.opt.scrolloff = 10
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
|
||||
vim.opt.shiftwidth = 4
|
||||
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.list = false
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- See `:help vim.keymap.set()`
|
||||
|
||||
|
|
@ -190,6 +197,8 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
||||
vim.keymap.set('n', '<leader><tab>', '<Cmd>Neotree toggle<CR>', { desc = 'Toggle Neo-tree' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
|
|
@ -617,6 +626,15 @@ require('lazy').setup({
|
|||
-- But for many setups, the LSP (`tsserver`) will work just fine
|
||||
-- tsserver = {},
|
||||
--
|
||||
eslint = {
|
||||
-- Enable auto-fix on save
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
buffer = bufnr,
|
||||
command = 'EslintFixAll',
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
lua_ls = {
|
||||
-- cmd = {...},
|
||||
|
|
@ -640,6 +658,12 @@ require('lazy').setup({
|
|||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
'eslint-lsp', -- ESLint Language Server
|
||||
})
|
||||
|
||||
require('mason').setup()
|
||||
|
||||
-- You can add other tools here that you want Mason to install
|
||||
|
|
@ -681,22 +705,6 @@ require('lazy').setup({
|
|||
},
|
||||
opts = {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
-- Disable "format_on_save lsp_fallback" for languages that don't
|
||||
-- have a well standardized coding style. You can add additional
|
||||
-- languages here or re-enable it for the disabled ones.
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
local lsp_format_opt
|
||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||
lsp_format_opt = 'never'
|
||||
else
|
||||
lsp_format_opt = 'fallback'
|
||||
end
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_format = lsp_format_opt,
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
|
|
@ -823,12 +831,7 @@ require('lazy').setup({
|
|||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{ -- You can easily change to a different colorscheme.
|
||||
-- Change the name of the colorscheme plugin below, and then
|
||||
-- change the command in the config to whatever the name of that colorscheme is.
|
||||
--
|
||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||
{
|
||||
'folke/tokyonight.nvim',
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function()
|
||||
|
|
@ -929,7 +932,7 @@ require('lazy').setup({
|
|||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
||||
-- { import = 'custom.plugins' },
|
||||
{ import = 'custom.plugins' },
|
||||
}, {
|
||||
ui = {
|
||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||
|
|
@ -952,5 +955,6 @@ require('lazy').setup({
|
|||
},
|
||||
})
|
||||
|
||||
vim.cmd 'highlight Normal ctermbg=none guibg=none'
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
-- vim: ts=2 sts=2 sw=2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue