a
This commit is contained in:
@@ -0,0 +1 @@
|
||||
My neovim configuration files, work in progress this is just a temporary repo
|
||||
@@ -0,0 +1,9 @@
|
||||
require("config.options")
|
||||
require("config.keybinds")
|
||||
require("plugins.telescope")
|
||||
require("plugins.catppuccin")
|
||||
require("plugins.lualine")
|
||||
require("plugins.treesitter")
|
||||
require("plugins.lsp")
|
||||
require("plugins.nvim-tree")
|
||||
require("plugins.other-plugins")
|
||||
@@ -0,0 +1,8 @@
|
||||
-- Keybinds
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Source
|
||||
vim.keymap.set("n", "<leader><leader>", vim.cmd.so)
|
||||
|
||||
-- Navigation
|
||||
vim.keymap.set("n", "<leader>q", "<C-w>l")
|
||||
@@ -0,0 +1,30 @@
|
||||
-- vim.options by default
|
||||
local set = vim.opt
|
||||
|
||||
-- indentation related
|
||||
set.shiftwidth = 4
|
||||
set.tabstop = 4
|
||||
set.autoindent = true
|
||||
set.expandtab = true
|
||||
|
||||
-- line numbers
|
||||
set.number = true
|
||||
|
||||
-- appearance
|
||||
set.ignorecase = true
|
||||
set.smartcase = true
|
||||
set.cursorline = true
|
||||
set.updatetime = 50
|
||||
|
||||
-- searching
|
||||
set.ignorecase = true
|
||||
set.smartcase = true
|
||||
set.incsearch = true
|
||||
|
||||
-- clipboard
|
||||
set.clipboard:append("unnamedplus")
|
||||
|
||||
-- undo dir
|
||||
set.swapfile = false
|
||||
set.backup = false
|
||||
set.undofile = true
|
||||
@@ -0,0 +1,3 @@
|
||||
vim.pack.add { { src = "https://github.com/catppuccin/nvim", name = "catppuccin" } }
|
||||
vim.cmd.colorscheme "catppuccin-mocha"
|
||||
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
@@ -0,0 +1,87 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
-- Autocompletion
|
||||
'https://github.com/hrsh7th/cmp-nvim-lsp',
|
||||
'https://github.com/hrsh7th/cmp-buffer',
|
||||
'https://github.com/hrsh7th/cmp-path',
|
||||
'https://github.com/hrsh7th/cmp-cmdline',
|
||||
'https://github.com/hrsh7th/nvim-cmp',
|
||||
-- Snippets
|
||||
'https://github.com/hrsh7th/cmp-vsnip',
|
||||
'https://github.com/hrsh7th/vim-vsnip',
|
||||
'https://github.com/L3MON4D3/LuaSnip',
|
||||
'https://github.com/saadparwaizl/cmp_luasnip',
|
||||
-- github
|
||||
'https://github.com/petertriho/cmp-git'
|
||||
})
|
||||
|
||||
-- Set up nvim-cmp.
|
||||
local cmp = require 'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup()
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.config('nixd', {
|
||||
cmd = { "nixd" },
|
||||
filetypes = { "nix" },
|
||||
capabilities = capabilities
|
||||
})
|
||||
vim.lsp.enable({ "lua_ls", "nixd" })
|
||||
@@ -0,0 +1,10 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/nvim-tree/nvim-web-devicons',
|
||||
'https://github.com/nvim-lualine/lualine.nvim'
|
||||
})
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'catppuccin-mocha',
|
||||
icons_enabled = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
vim.pack.add({
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' }, -- optional
|
||||
{ src = 'https://github.com/nvim-tree/nvim-tree.lua' },
|
||||
})
|
||||
|
||||
-- disable netrw at the very start of your init.lua
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- optionally enable 24-bit colour
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- empty setup using defaults
|
||||
require("nvim-tree").setup()
|
||||
|
||||
-- OR setup with a config
|
||||
|
||||
---@type nvim_tree.config
|
||||
local config = {
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
}
|
||||
require("nvim-tree").setup(config)
|
||||
|
||||
vim.keymap.set("n", "<leader>e", vim.cmd.NvimTreeFocus)
|
||||
vim.keymap.set("n", "<leader>q", vim.cmd.NvimTreeCollapse)
|
||||
@@ -0,0 +1,9 @@
|
||||
vim.pack.add ({
|
||||
'https://github.com/ojroques/vim-oscyank', -- Shared ssh clipboard
|
||||
'https://github.com/tpope/vim-fugitive', -- Git plugin
|
||||
'https://github.com/brenoprata10/nvim-highlight-colors' -- Shows CSS colors when editing files
|
||||
})
|
||||
|
||||
-- CSS colors
|
||||
vim.opt.termguicolors = true
|
||||
require('nvim-highlight-colors').setup({})
|
||||
@@ -0,0 +1,11 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/nvim-telescope/telescope.nvim',
|
||||
'https://github.com/nvim-lua/plenary.nvim',
|
||||
'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
|
||||
'https://github.com/nvim-tree/nvim-web-devicons'
|
||||
})
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
|
||||
@@ -0,0 +1,19 @@
|
||||
vim.pack.add ({
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||
})
|
||||
|
||||
require('nvim-treesitter').setup {
|
||||
-- Directory to install parsers and queries to (prepended to `runtimepath` to have priority)
|
||||
install_dir = vim.fn.stdpath('data') .. '/site'
|
||||
}
|
||||
-- Required parsers and queries
|
||||
require('nvim-treesitter').install { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' }
|
||||
|
||||
-- Syntax highlighting
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'lua', 'nix', 'javascript', 'html', 'css', 'c', 'cpp', 'python', 'kdl', 'markdown' },
|
||||
callback = function() vim.treesitter.start() end,
|
||||
})
|
||||
|
||||
-- Auto indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"plugins": {
|
||||
"LuaSnip": {
|
||||
"rev": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24",
|
||||
"src": "https://github.com/L3MON4D3/LuaSnip"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "9dcb1f3a9164f10c8950a790aace576f2e89dc78",
|
||||
"src": "https://github.com/Saghen/blink.cmp"
|
||||
},
|
||||
"blink.lib": {
|
||||
"rev": "5876dd95deeb70aadbe9f1c0b7117a135061cdac",
|
||||
"src": "https://github.com/Saghen/blink.lib"
|
||||
},
|
||||
"catppuccin": {
|
||||
"rev": "e068ab5f8261f23f6f71ffd8791ae40315b77b9c",
|
||||
"src": "https://github.com/catppuccin/nvim"
|
||||
},
|
||||
"cmp-buffer": {
|
||||
"rev": "b74fab3656eea9de20a9b8116afa3cfc4ec09657",
|
||||
"src": "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
"cmp-cmdline": {
|
||||
"rev": "d126061b624e0af6c3a556428712dd4d4194ec6d",
|
||||
"src": "https://github.com/hrsh7th/cmp-cmdline"
|
||||
},
|
||||
"cmp-git": {
|
||||
"rev": "e645f69b93eede43fb644bb1a0b1db3eef1108a3",
|
||||
"src": "https://github.com/petertriho/cmp-git"
|
||||
},
|
||||
"cmp-nvim-lsp": {
|
||||
"rev": "cbc7b02bb99fae35cb42f514762b89b5126651ef",
|
||||
"src": "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
"cmp-path": {
|
||||
"rev": "c642487086dbd9a93160e1679a1327be111cbc25",
|
||||
"src": "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
"cmp-vsnip": {
|
||||
"rev": "989a8a73c44e926199bfd05fa7a516d51f2d2752",
|
||||
"src": "https://github.com/hrsh7th/cmp-vsnip"
|
||||
},
|
||||
"cmp_luasnip": {
|
||||
"rev": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90",
|
||||
"src": "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
"fd": {
|
||||
"rev": "fb1486f210885ae663338ebfab4e70210abc4809",
|
||||
"src": "https://github.com/sharkdp/fd"
|
||||
},
|
||||
"friendly-snippets": {
|
||||
"rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9",
|
||||
"src": "https://github.com/rafamadriz/friendly-snippets"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"nvim-cmp": {
|
||||
"rev": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca",
|
||||
"src": "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
"nvim-highlight-colors": {
|
||||
"rev": "e4c7af0211866162d999ce0bdd6a029302e19139",
|
||||
"src": "https://github.com/brenoprata10/nvim-highlight-colors"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "d224a1920728ba129880efc700d4a0180ac4ecbb",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-tree.lua": {
|
||||
"rev": "7ff7040bf6c246671eb55cb1727de4fd9f92a106",
|
||||
"src": "https://github.com/nvim-tree/nvim-tree.lua"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "dad71387de386a946b123079d0e53f23028f3abd",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "74b06c6c75e4eeb3108ec01852001636d85a932b",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "b25b749b9db64d375d782094e2b9dce53ad53a40",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "427b576c16792edad01a92b89721d923c19ad60f",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"vim-oscyank": {
|
||||
"rev": "d67d76b2f19b868b70a1cf33a779d71dc092cb30",
|
||||
"src": "https://github.com/ojroques/vim-oscyank"
|
||||
},
|
||||
"vim-vsnip": {
|
||||
"rev": "9bcfabea653abdcdac584283b5097c3f8760abaa",
|
||||
"src": "https://github.com/hrsh7th/vim-vsnip"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user