Compare commits

..

1 Commits

Author SHA1 Message Date
c51164f6e0 Added branch for office/windows environment 2023-08-04 07:36:32 +00:00
16 changed files with 258 additions and 285 deletions

2
.gitignore vendored
View File

@ -1,3 +1 @@
plugin/packer_compiled.lua plugin/packer_compiled.lua
lazy-lock.json

View File

@ -1,13 +0,0 @@
{
"runtime.version": "LuaJIT",
"runtime.path": [
"lua/?.lua",
"lua/?/init.lua"
],
"diagnostics.globals": ["vim"],
"workspace.checkThirdParty": false,
"workspace.library": [
"$VIMRUNTIME",
"./lua"
]
}

View File

@ -15,7 +15,7 @@ local config = {
["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} }, ["`"] = { escape = true, close = true, pair = "``", disabled_filetypes = {} },
}, },
options = { options = {
disabled_filetypes = { "text", "markdown", "norg" }, disabled_filetypes = { "text", "markdown" },
disable_when_touch = false, disable_when_touch = false,
pair_spaces = false, pair_spaces = false,
auto_indent = true, auto_indent = true,

View File

@ -1,9 +1,40 @@
-- pretty location at the top -- pretty location at the top
require("barbecue").setup({ require("barbecue").setup({
---Whether to attach navic to language servers automatically.
---
---@type boolean
attach_navic = true,
---Whether to create winbar updater autocmd.
---
---@type boolean
create_autocmd = true,
---Buftypes to enable winbar in.
---
---@type string[]
include_buftypes = { "" },
---Filetypes not to enable winbar in. ---Filetypes not to enable winbar in.
--- ---
---@type string[] ---@type string[]
exclude_filetypes = { "netrw", "toggleterm", "neogit" }, exclude_filetypes = { "netrw", "toggleterm" },
modifiers = {
---Filename modifiers applied to dirname.
---
---See: `:help filename-modifiers`
---
---@type string
dirname = ":~:.",
---Filename modifiers applied to basename.
---
---See: `:help filename-modifiers`
---
---@type string
basename = "",
},
---Whether to display path to file. ---Whether to display path to file.
--- ---
@ -32,4 +63,96 @@ require("barbecue").setup({
--- ---
---@type boolean ---@type boolean
show_navic = true, show_navic = true,
---Get leading custom section contents.
---
---NOTE: This function shouldn't do any expensive actions as it is run on each
---render.
---
---@type fun(bufnr: number, winnr: number): barbecue.Config.custom_section
lead_custom_section = function() return " " end,
---@alias barbecue.Config.custom_section
---|string # Literal string.
---|{ [1]: string, [2]: string? }[] # List-like table of `[text, highlight?]` tuples in which `highlight` is optional.
---
---Get custom section contents.
---
---NOTE: This function shouldn't do any expensive actions as it is run on each
---render.
---
---@type fun(bufnr: number, winnr: number): barbecue.Config.custom_section
custom_section = function() return " " end,
---@alias barbecue.Config.theme
---|'"auto"' # Use your current colorscheme's theme or generate a theme based on it.
---|string # Theme located under `barbecue.theme` module.
---|barbecue.Theme # Same as '"auto"' but override it with the given table.
---
---Theme to be used for generating highlight groups dynamically.
---
---@type barbecue.Config.theme
--theme = "auto",
theme = {
basename = { bold = false},
},
---Whether context text should follow its icon's color.
---
---@type boolean
context_follow_icon_color = false,
symbols = {
---Modification indicator.
---
---@type string
modified = "",
---Truncation indicator.
---
---@type string
ellipsis = "",
---Entry separator.
---
---@type string
separator = "",
},
---@alias barbecue.Config.kinds
---|false # Disable kind icons.
---|table<string, string> # Type to icon mapping.
---
---Icons for different context entry kinds.
---
---@type barbecue.Config.kinds
kinds = {
File = "",
Module = "",
Namespace = "",
Package = "",
Class = "",
Method = "",
Property = "",
Field = "",
Constructor = "",
Enum = "",
Interface = "",
Function = "",
Variable = "",
Constant = "",
String = "",
Number = "",
Boolean = "",
Array = "",
Object = "",
Key = "",
Null = "",
EnumMember = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
}) })

View File

@ -1,44 +1,11 @@
local harpoon = require("harpoon") -- fast switching between files
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
-- REQUIRED vim.keymap.set("n", "<leader>a", mark.add_file)
harpoon:setup({}) vim.keymap.set("n", "<leader>h", ui.toggle_quick_menu)
-- REQUIRED
--
-- basic telescope configuration
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
vim.keymap.set("n", "<leader>H", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon in telescope" })
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end,
{ desc = "Harpoon: Add current buffer" })
vim.keymap.set("n", "<leader>hh", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end,
{ desc = "Harpoon: Toggle quick menu" })
vim.keymap.set("n", "<C-h>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<C-j>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<C-k>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<C-l>", function() harpoon:list():select(4) end)
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<leader>hp", function() harpoon:list():prev() end,
{ desc = "Harpoon: Previous buffer" })
vim.keymap.set("n", "<leader>hn", function() harpoon:list():next() end,
{ desc = "Harpoon: Next buffer" })
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-j>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-k>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-l>", function() ui.nav_file(4) end)

View File

@ -1,15 +1,11 @@
local lsp_zero = require('lsp-zero') -- language server manager (via Mason)
local lsp = require('lsp-zero').preset({})
lsp_zero.on_attach(function(client, bufnr) lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings lsp.default_keymaps({buffer = bufnr})
-- to learn the available actions
lsp_zero.default_keymaps({buffer = bufnr})
end) end)
require('mason').setup({}) -- (Optional) Configure lua language server for neovim
require('mason-lspconfig').setup({ require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())
ensure_installed = {},
handlers = { lsp.setup()
lsp_zero.default_setup,
},
})

View File

@ -1,44 +0,0 @@
require('oil').setup({
default_file_explorer = false,
columns = {
-- "icon",
-- "permissions",
-- "size",
-- "mtime",
},
float = {
-- Padding around the floating window
padding = 8,
max_width = 80,
max_height = 64,
border = "rounded",
win_options = {
winblend = 0,
},
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
override = function(conf)
return conf
end,
},
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = "actions.select_vsplit",
["<C-h>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<Esc>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["g."] = "actions.toggle_hidden",
},
})
vim.keymap.set('n', '<leader>-', ":Oil --float <CR>")

View File

@ -1,13 +0,0 @@
require("auto-session").setup {
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/"},
}
require('session-lens').setup({
path_display = {'shorten'},
theme_conf = { border = true },
previewer = false,
})
vim.keymap.set('n', '<leader>ss', ":SearchSession<CR>")

View File

@ -1,7 +1,7 @@
-- finding files in working dir and repo -- finding files in working dir and repo
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fp', builtin.git_files, {}) vim.keymap.set('n', '<leader>pf', builtin.git_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' }) vim.keymap.set('n', '<leader>ps', function()
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' }) builtin.grep_string({ search = vim.fn.input("Grep > ") });
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' }) end)

View File

@ -1,8 +1,8 @@
-- parsing and highlighting -- parsing and highlighting
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed) -- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "python", "javascript", "typescript", "php", "c", "rust", "bash", "lua", "vim", "vimdoc", "query" },
ensure_installed = 'all',
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
@ -12,10 +12,12 @@ require'nvim-treesitter.configs'.setup {
highlight = { highlight = {
enable = true, enable = true,
},
-- Needed because treesitter highlight turns off autoindent for php files
indent = { -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
enable = true, -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
}, },
} }

View File

@ -1,16 +1 @@
require("sevi-kun") require("sevi-kun")
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)
require("lazy").setup("sevi-kun.plugins")

101
lua/sevi-kun/packer.lua Normal file
View File

@ -0,0 +1,101 @@
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
-- Only required if you have packer configured as `opt`
vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- treesitter
use ('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
use ('nvim-treesitter/playground')
use ('nvim-treesitter/nvim-treesitter-context')
-- useful
use {
'nvim-telescope/telescope.nvim', tag = '0.1.2',
requires = 'nvim-lua/plenary.nvim'
}
use {
'ThePrimeagen/harpoon',
requires = 'nvim-lua/plenary.nvim'
}
use {
'NeogitOrg/neogit',
requires = 'nvim-lua/plenary.nvim'
}
use({
"kylechui/nvim-surround",
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup()
end
})
use {
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end
}
use ('mbbill/undotree')
use {
'm4xshen/autoclose.nvim',
config = function ()
require("autoclose").setup()
end
}
-- pretty
use {
"loctvl842/monokai-pro.nvim",
config = function()
require("monokai-pro").setup()
vim.cmd([[colorscheme monokai-pro]])
end
}
use {
"utilyre/barbecue.nvim", tag = "*",
requires = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons", -- optional dependency
},
after = "nvim-web-devicons", -- keep this if you're using NvChad
config = function()
require("barbecue").setup()
end,
}
-- lsp
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
requires = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{ -- Optional
'williamboman/mason.nvim',
run = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{'williamboman/mason-lspconfig.nvim'}, -- Optional
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'L3MON4D3/LuaSnip'}, -- Required
}
}
end)

View File

@ -1,116 +0,0 @@
-- lazy.nvim plugins
return {
-- treesitter
{ "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
},
{ "nvim-treesitter/playground" },
{ "nvim-treesitter/nvim-treesitter-context" },
-- useful
{ "rmagatti/session-lens",
dependencies = {
"rmagatti/auto-session",
"nvim-telescope/telescope.nvim"
}
},
{ "nvim-telescope/telescope.nvim",
version = "0.1.x",
dependencies = { "nvim-lua/plenary.nvim" }
},
{ "ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" },
},
{ "NeogitOrg/neogit",
branch = "master",
dependencies = {
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim",
}
},
{ "stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }
},
{ "kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
config = function()
require("nvim-surround").setup()
end
},
{ "numToStr/Comment.nvim",
lazy = false,
config = function()
require("Comment").setup()
end
},
{ "mbbill/undotree" },
{ "m4xshen/autoclose.nvim",
config = function ()
require("autoclose").setup()
end
},
-- pretty
{ "navarasu/onedark.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme onedark")
end
},
{ "lukas-reineke/indent-blankline.nvim",
lazy = false,
main = "ibl",
opts = {},
config = function()
require("ibl").setup({})
end
},
{ "utilyre/barbecue.nvim",
lazy = false,
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
},
},
-- lsp
{
"Exafunction/codeium.vim",
event = "BufEnter"
},
{"williamboman/mason.nvim",
config = function()
require("mason").setup({})
end
},
{"williamboman/mason-lspconfig.nvim"},
{"VonHeikemen/lsp-zero.nvim", branch = "v3.x"},
{"neovim/nvim-lspconfig"},
{"hrsh7th/cmp-nvim-lsp"},
{"hrsh7th/nvim-cmp"},
{"L3MON4D3/LuaSnip"},
}

View File

@ -3,10 +3,6 @@ vim.g.mapleader = " "
vim.keymap.set("n", "<leader>.", vim.cmd.Ex) vim.keymap.set("n", "<leader>.", vim.cmd.Ex)
vim.keymap.set("n", "<C-b>", ":e #<CR>")
vim.keymap.set("n", "<C-b>w", ":wq<CR>")
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv") vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
@ -21,7 +17,4 @@ vim.keymap.set("n", "<leader>y", "\"+y")
vim.keymap.set("v", "<leader>y", "\"+y") vim.keymap.set("v", "<leader>y", "\"+y")
vim.keymap.set("n", "<leader>Y", "\"+Y") vim.keymap.set("n", "<leader>Y", "\"+Y")
vim.keymap.set("n", "<F5>", ":make")
vim.keymap.set("n", "<leader>vs", ":vs #<CR>")
vim.keymap.set("n", "<leader>sp", ":sp #<CR>")

View File

@ -1,9 +1,5 @@
vim.g.mapleader = " "
vim.opt.nu = true vim.opt.nu = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
vim.opt.ignorecase = true
vim.opt.cursorline = true
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
@ -16,10 +12,10 @@ vim.opt.wrap = false
vim.opt.swapfile = false vim.opt.swapfile = false
vim.opt.backup = false vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undodir = os.getenv("LOCALAPPDATA") .. "\\nvim-data\\undodir"
vim.opt.undofile = true vim.opt.undofile = true
vim.opt.hlsearch = true vim.opt.hlsearch = false
vim.opt.incsearch = true vim.opt.incsearch = true
vim.opt.termguicolors = true vim.opt.termguicolors = true
@ -32,6 +28,4 @@ vim.opt.updatetime = 50
vim.opt.colorcolumn = "80" vim.opt.colorcolumn = "80"
vim.g.netrw_preview = 1 vim.g.mapleader = " "
vim.g.netrw_liststyle = 3
vim.g.netrw_winsize = 30