lualine config edits
This commit is contained in:
parent
9331121a9f
commit
5c937dc1c8
|
@ -0,0 +1,42 @@
|
|||
return {
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
opts = {
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'default' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = false } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
}
|
|
@ -4,6 +4,6 @@ if not status_ok then
|
|||
end
|
||||
|
||||
require "user.lsp.mason"
|
||||
-- require("user.lsp.handlers").setup()
|
||||
require("user.lsp.handlers").setup()
|
||||
require "user.lsp.null-ls"
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup {
|
||||
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
|
||||
ignore_install = { "" }, -- List of parsers to ignore installing
|
||||
autopairs = {
|
||||
enable = true,
|
||||
},
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = { "" }, -- list of language that will be disabled
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = { enable = true, disable = { "yaml" } },
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
}
|
33
init.lua
33
init.lua
|
@ -1,23 +1,22 @@
|
|||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
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
|
||||
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)
|
||||
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
require('lazy').setup('plugins', {
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
|
@ -26,16 +25,8 @@ require("lazy").setup("plugins", {
|
|||
require 'user.options'
|
||||
require 'user.keymaps'
|
||||
require 'user.colorscheme'
|
||||
require 'user.autocmds'
|
||||
-- require 'user.cmp'
|
||||
-- require 'user.lsp'
|
||||
-- require 'user.treesitter'
|
||||
-- require 'user.autopairs'
|
||||
-- require 'user.nvim-tree'
|
||||
-- require 'user.bufferline'
|
||||
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,
|
||||
})
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- 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,2 @@
|
|||
local names = { "Norsh", "Dan", "Bisc", "Ella"}
|
||||
return names
|
|
@ -0,0 +1,5 @@
|
|||
local fam = require('learn.learning')
|
||||
print(fam[1])
|
||||
-- for i, v in ipairs(fam) do
|
||||
-- print(i, v)
|
||||
-- end
|
|
@ -1,4 +1,5 @@
|
|||
return {
|
||||
{'folke/tokyonight.nvim'},
|
||||
{ "nvim-lua/popup.nvim" }, -- An implementation of the Popup API from vim in Neovim
|
||||
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used ny lots of plugins
|
||||
{ "windwp/nvim-autopairs" }, -- Autopairs
|
||||
|
@ -7,15 +8,15 @@ return {
|
|||
-- Colorschemes
|
||||
-- "lunarvim/colorschemes" -- A bunch of colorschemes you can try out
|
||||
{ "lunarvim/darkplus.nvim" },
|
||||
{ "akinsho/bufferline.nvim" },
|
||||
{ "moll/vim-bbye" },
|
||||
-- cmp plugins
|
||||
{ "hrsh7th/nvim-cmp" }, -- The completion plugin
|
||||
{ "hrsh7th/cmp-buffer" }, -- buffer completions
|
||||
{ "hrsh7th/cmp-path" }, -- path completions
|
||||
{ "hrsh7th/cmp-cmdline" }, -- cmdline completions
|
||||
{ "saadparwaiz1/cmp_luasnip" }, -- snippet completions
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
-- { "hrsh7th/nvim-cmp" }, -- The completion plugin
|
||||
-- { "hrsh7th/cmp-buffer" }, -- buffer completions
|
||||
-- { "hrsh7th/cmp-path" }, -- path completions
|
||||
-- { "hrsh7th/cmp-nvim-lua" },
|
||||
-- { "hrsh7th/cmp-cmdline" }, -- cmdline completions
|
||||
-- { "saadparwaiz1/cmp_luasnip" }, -- snippet completions
|
||||
-- { "hrsh7th/cmp-nvim-lsp" },
|
||||
|
||||
-- snippets
|
||||
{ "L3MON4D3/LuaSnip" }, --snippet engine
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter", -- Load when entering insert mode
|
||||
config = function()
|
||||
local autopairs = require("nvim-autopairs")
|
||||
|
||||
autopairs.setup({
|
||||
disable_filetype = { "TelescopePrompt", "vim" },
|
||||
check_ts = true, -- Use Treesitter to check for pairs
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string nodes
|
||||
javascript = { "template_string" },
|
||||
java = false, -- disable treesitter check for Java
|
||||
},
|
||||
fast_wrap = {
|
||||
map = "<M-e>", -- Alt+e to trigger fast wrap
|
||||
chars = { "{", "[", "(", '"', "'" },
|
||||
pattern = [=[[%'%"%>%]%)%}%,]]=],
|
||||
end_key = "$",
|
||||
before_key = "h",
|
||||
after_key = "l",
|
||||
cursor_pos_before = true,
|
||||
keys = "qwertyuiopzxcvbnmasdfghjkl",
|
||||
manual_position = true,
|
||||
highlight = "Search",
|
||||
highlight_grey = "Comment"
|
||||
},
|
||||
enable_check_bracket_line = true, -- Don't add a pair if the closing bracket is already on the same line
|
||||
ignored_next_char = "[%w%.]", -- Will ignore alphanumeric and `.` after the pair
|
||||
})
|
||||
|
||||
-- Optional: Integration with nvim-cmp for auto completion pairing
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if cmp_status_ok then
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end
|
||||
end,
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 9999,
|
||||
lazy = false,
|
||||
opts = {
|
||||
notifier = { enabled = true },
|
||||
dashboard = {
|
||||
|
@ -42,3 +40,4 @@ return {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
-- ~/.config/nvim/lua/plugins/lspconfig.lua
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile", "BufWritePre" },
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- Example: Python
|
||||
lspconfig.pyright.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
|
||||
-- Example: Lua
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -9,5 +9,16 @@ return {
|
|||
section_separators = "",
|
||||
component_separators = "",
|
||||
},
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
path=1
|
||||
},
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
-- Completion sources
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
|
||||
-- Snippet engine
|
||||
"L3MON4D3/LuaSnip",
|
||||
|
||||
-- Optional: VSCode-style icons
|
||||
"onsails/lspkind.nvim",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<C-space>"] = cmp.mapping.complete(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text", -- "text", "symbol", or "symbol_text"
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
-- Cmdline completion (optional)
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" }
|
||||
}, {
|
||||
{ name = "cmdline" }
|
||||
})
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate", -- ensures parsers stay updated
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = { "python", "javascript", "go" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-s>",
|
||||
node_decremental = "<C-backspace>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,9 +1,3 @@
|
|||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
--
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
|
|
|
@ -57,7 +57,6 @@ keymap('v', '<A-k>', ':m .-2<CR>==', opts)
|
|||
-- paste over currently selected text without yanking it
|
||||
keymap('v', 'p', '"_dp', opts)
|
||||
keymap('v', 'P', '"_dP', opts)
|
||||
|
||||
-- Visual Block --
|
||||
-- Move text up and down
|
||||
keymap('x', 'J', ":move '>+1<CR>gv-gv", opts)
|
||||
|
@ -131,3 +130,6 @@ vim.keymap.set("n", "<C-a>", "ggVG", opts)
|
|||
|
||||
vim.keymap.set("n", "YY", "va{Vy", opts)
|
||||
vim.keymap.set("n", "<leader>r", ":w<CR>:!python3 %<CR>", { noremap = true, silent = true })
|
||||
vim.keymap.set("n", "<leader><leader>x", ":source %<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>x", ":.lua<CR>", opts)
|
||||
vim.keymap.set("v", "<leader>x", ":lua<CR>", opts)
|
||||
|
|
|
@ -35,12 +35,12 @@ local options = {
|
|||
guifont = 'monospace:h17', -- the font used in graphical neovim applications
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append 'c'
|
||||
-- vim.opt.shortmess:append 'c'
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
vim.cmd 'set whichwrap+=<,>,[,],h,l'
|
||||
vim.cmd [[set iskeyword+=-]]
|
||||
vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work
|
||||
-- vim.cmd 'set whichwrap+=<,>,[,],h,l'
|
||||
-- vim.cmd [[set iskeyword+=-]]
|
||||
-- vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work
|
||||
|
|
Loading…
Reference in New Issue