137 lines
3.7 KiB
Lua
137 lines
3.7 KiB
Lua
vim.g.mapleader = ";"
|
|
vim.g.maplocalleader = ";"
|
|
vim.opt.termguicolors = true
|
|
vim.cmd.colorscheme('default')
|
|
vim.opt.clipboard = 'unnamedplus'
|
|
vim.opt.undofile = true
|
|
vim.opt.updatetime = 250
|
|
vim.opt.showmode = false
|
|
vim.opt.number = true
|
|
vim.opt.relativenumber = false
|
|
vim.opt.mouse = 'a'
|
|
vim.opt.ignorecase = true
|
|
vim.opt.smartcase = true
|
|
vim.opt.splitright = true
|
|
vim.opt.splitbelow = true
|
|
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
|
vim.keymap.set('n', '<right>', '<cmd>echo"Use l to move!!"<CR>')
|
|
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
|
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
|
|
|
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
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.api.nvim_create_autocmd('TextYankPost', {
|
|
desc = 'Highlight when yanking (copying) text',
|
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
|
callback = function()
|
|
vim.highlight.on_yank()
|
|
end,
|
|
})
|
|
|
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
vim.fn.system({
|
|
"git",
|
|
"clone",
|
|
"--filter=blob:none",
|
|
"https://github.com/folke/lazy.nvim.git",
|
|
"--branch=stable", -- latest stable release
|
|
lazypath,
|
|
})
|
|
end
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
local plugins = {
|
|
"ms-jpq/coq_nvim",
|
|
"nvim-lua/plenary.nvim",
|
|
"nvim-telescope/telescope.nvim",
|
|
"kelly-lin/ranger.nvim",
|
|
"NTBBloodbath/galaxyline.nvim",
|
|
"romgrk/barbar.nvim",
|
|
"yamatsum/nvim-cursorline",
|
|
"nvim-treesitter/nvim-treesitter",
|
|
"kyazdani42/nvim-web-devicons",
|
|
"dnlhc/glance.nvim",
|
|
"xiyaowong/transparent.nvim",
|
|
"nvim-lualine/lualine.nvim",
|
|
"folke/which-key.nvim",
|
|
event = "VeryLazy",
|
|
init = function()
|
|
vim.o.timeout = true
|
|
vim.o.timeoutlen = 300
|
|
end,
|
|
"j-hui/fidget.nvim",
|
|
"folke/neodev.nvim",
|
|
'VonHeikemen/lsp-zero.nvim',
|
|
"neovim/nvim-lspconfig",
|
|
'williamboman/mason.nvim',
|
|
'williamboman/mason-lspconfig.nvim',
|
|
'hrsh7th/nvim-cmp',
|
|
'hrsh7th/cmp-nvim-lsp',
|
|
'L3MON4D3/LuaSnip',
|
|
'lambdalisue/suda.vim',
|
|
}
|
|
|
|
require("lazy").setup(plugins, opts)
|
|
|
|
local lsp_zero = require('lsp-zero')
|
|
|
|
lsp_zero.on_attach(function(client, bufnr)
|
|
lsp_zero.default_keymaps({buffer = bufnr})
|
|
end)
|
|
|
|
require('mason').setup({})
|
|
require('mason-lspconfig').setup({
|
|
handlers = {
|
|
lsp_zero.default_setup,
|
|
lua_ls = function()
|
|
local lua_opts = lsp_zero.nvim_lua_ls()
|
|
require('lspconfig').lua_ls.setup(lua_opts)
|
|
end,
|
|
}
|
|
})
|
|
|
|
|
|
require('lualine').setup {
|
|
options = {
|
|
icons_enabled = true,
|
|
theme = 'auto',
|
|
component_separators = { left = '', right = ''},
|
|
section_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 = {'progress'},
|
|
lualine_z = {'location'}
|
|
},
|
|
inactive_sections = {
|
|
lualine_a = {},
|
|
lualine_b = {},
|
|
lualine_c = {'filename'},
|
|
lualine_x = {'location'},
|
|
lualine_y = {},
|
|
lualine_z = {}
|
|
},
|
|
tabline = {},
|
|
winbar = {},
|
|
inactive_winbar = {},
|
|
extensions = {}
|
|
}
|