neovim setup stuff
parent
95fd2d0a2f
commit
5a916f838a
@ -0,0 +1,13 @@
|
||||
require("rose-pine").setup({
|
||||
variant = "moon"
|
||||
})
|
||||
|
||||
function SetColour(colour)
|
||||
colour = colour or "gruvbox"
|
||||
vim.cmd(string.format("colorscheme %s", colour))
|
||||
|
||||
--vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
--vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
|
||||
SetColour()
|
@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
@ -0,0 +1,38 @@
|
||||
local lsp = require('lsp-zero')
|
||||
|
||||
lsp.preset('recommended')
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
'lua_ls',
|
||||
'gopls',
|
||||
'rust_analyzer',
|
||||
'cmake',
|
||||
'clangd',
|
||||
'zls',
|
||||
'bashls',
|
||||
}
|
||||
})
|
||||
|
||||
lsp.nvim_workspace()
|
||||
|
||||
lsp.set_preferences({
|
||||
sign_icons = { }
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "gh", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
lsp.setup()
|
@ -0,0 +1,11 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fp', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
--vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
--vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
|
||||
vim.keymap.set('n', '<leader>ps', function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") });
|
||||
end)
|
@ -0,0 +1,27 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "c", "lua", "vim", "go", "zig", "rust" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (for "all")
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- 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,
|
||||
},
|
||||
}
|
@ -0,0 +1 @@
|
||||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
@ -0,0 +1 @@
|
||||
require("RageCage64")
|
@ -0,0 +1,3 @@
|
||||
require("RageCage64.remap")
|
||||
require("RageCage64.packer")
|
||||
require("RageCage64.set")
|
@ -0,0 +1,50 @@
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- Navigation
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.1',
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
-- Colours
|
||||
use("ellisonleao/gruvbox.nvim")
|
||||
use({'rose-pine/neovim', as = 'rose-pine' })
|
||||
|
||||
-- Treesitter
|
||||
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
|
||||
use('nvim-treesitter/playground')
|
||||
|
||||
-- Editing
|
||||
use('mbbill/undotree')
|
||||
use('tpope/vim-surround')
|
||||
use('tpope/vim-commentary')
|
||||
|
||||
-- LSP
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v2.x',
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{'neovim/nvim-lspconfig'}, -- Required
|
||||
{ -- Optional
|
||||
'williamboman/mason.nvim',
|
||||
run = function()
|
||||
vim.cmd [[MasonUpdate]]
|
||||
end,
|
||||
},
|
||||
{'williamboman/mason-lspconfig.nvim'}, -- Optional
|
||||
|
||||
-- Autocompletion
|
||||
{'hrsh7th/nvim-cmp'}, -- Required
|
||||
{'hrsh7th/cmp-nvim-lsp'}, -- Required
|
||||
{'L3MON4D3/LuaSnip'}, -- Required
|
||||
},
|
||||
|
||||
use('tpope/vim-fugitive'),
|
||||
use('editorconfig/editorconfig-vim'),
|
||||
}
|
||||
end)
|
@ -0,0 +1,48 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
-- Paste over without copying in the pasted over word
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP")
|
||||
|
||||
-- From old vimrc
|
||||
|
||||
-- Enter and space completion
|
||||
local function enter_complete(seq)
|
||||
local open_seq = string.sub(seq, 1, math.floor(string.len(seq)/2))
|
||||
local close_seq = string.sub(seq, math.ceil(string.len(seq)/2)+1, string.len(seq))
|
||||
vim.keymap.set(
|
||||
"i",
|
||||
string.format("%s<cr>", open_seq),
|
||||
string.format("%s<cr>%s<c-o>O", open_seq, close_seq)
|
||||
)
|
||||
end
|
||||
|
||||
local function space_complete(seq)
|
||||
local open_seq = string.sub(seq, 1, string.len(seq)/2)
|
||||
local lefts = string.rep("<left>", string.len(seq)/2)
|
||||
vim.keymap.set(
|
||||
"i",
|
||||
string.format("%s<space>", open_seq),
|
||||
string.format("%s%s", seq, lefts)
|
||||
)
|
||||
end
|
||||
|
||||
enter_complete("{}")
|
||||
enter_complete("[]")
|
||||
enter_complete("({})")
|
||||
|
||||
space_complete("[]")
|
||||
space_complete("()")
|
||||
space_complete("<>")
|
||||
space_complete("{}")
|
||||
space_complete("({})")
|
||||
|
||||
-- Split management
|
||||
vim.keymap.set("n", "<leader>w", "<C-w>")
|
||||
vim.keymap.set("n", "<leader>ws", ":vsp<cr>")
|
||||
vim.keymap.set("n", "<leader>wi", ":sp<cr>")
|
||||
vim.keymap.set("n", "<leader>wt", ":tabnew<cr>")
|
||||
|
||||
vim.keymap.set("n", "<Leader>c", '"+')
|
||||
vim.keymap.set("v", "<Leader>c", '"+')
|
@ -0,0 +1,25 @@
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.softtabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = false
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME")
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
vim.opt.updatetime = 50
|
@ -0,0 +1 @@
|
||||
#!/usr/bin/env bash
|
Loading…
Reference in New Issue