mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-06-26 15:18:35 +02:00
Merge pull request #1 from grimvoodoo/feature/new-config
Feature/new config
This commit is contained in:
commit
1c03dd3a98
2 changed files with 73 additions and 19 deletions
33
init.lua
33
init.lua
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.opt`
|
||||||
|
@ -110,14 +110,6 @@ vim.opt.mouse = 'a'
|
||||||
-- Don't show the mode, since it's already in the status line
|
-- Don't show the mode, since it's already in the status line
|
||||||
vim.opt.showmode = false
|
vim.opt.showmode = false
|
||||||
|
|
||||||
-- Sync clipboard between OS and Neovim.
|
|
||||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
|
||||||
-- Remove this option if you want your OS clipboard to remain independent.
|
|
||||||
-- See `:help 'clipboard'`
|
|
||||||
vim.schedule(function()
|
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
vim.opt.breakindent = true
|
vim.opt.breakindent = true
|
||||||
|
|
||||||
|
@ -223,8 +215,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
error('Error cloning lazy.nvim:\n' .. out)
|
error('Error cloning lazy.nvim:\n' .. out)
|
||||||
end
|
end
|
||||||
end ---@diagnostic disable-next-line: undefined-field
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
---@type vim.Option
|
||||||
|
local rtp = vim.opt.rtp
|
||||||
|
rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- [[ Configure and install plugins ]]
|
-- [[ Configure and install plugins ]]
|
||||||
--
|
--
|
||||||
|
@ -239,7 +234,7 @@ vim.opt.rtp:prepend(lazypath)
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
|
||||||
|
|
||||||
-- NOTE: Plugins can also be added by using a table,
|
-- NOTE: Plugins can also be added by using a table,
|
||||||
-- with the first argument being the link and the following
|
-- with the first argument being the link and the following
|
||||||
|
@ -665,8 +660,8 @@ require('lazy').setup({
|
||||||
local servers = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
-- pyright = {},
|
pyright = {},
|
||||||
-- rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||||
--
|
--
|
||||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
|
@ -761,10 +756,10 @@ require('lazy').setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
-- python = { "isort", "black" },
|
python = { 'isort', 'black' },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
javascript = { 'prettierd', 'prettier' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -966,17 +961,17 @@ require('lazy').setup({
|
||||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||||
--
|
--
|
||||||
-- require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
-- require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
-- require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
-- require 'kickstart.plugins.neo-tree',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
--
|
--
|
||||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|
59
lua/custom/init.lua
Normal file
59
lua/custom/init.lua
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
local copy_to_unnamedplus = require('vim.ui.clipboard.osc52').copy '+'
|
||||||
|
copy_to_unnamedplus(vim.v.event.regcontents)
|
||||||
|
local copy_to_unnamed = require('vim.ui.clipboard.osc52').copy '*'
|
||||||
|
copy_to_unnamed(vim.v.event.regcontents)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
|
callback = function()
|
||||||
|
vim.highlight.on_yank()
|
||||||
|
local copy_to_unnamedplus = require('vim.ui.clipboard.osc52').copy '+'
|
||||||
|
copy_to_unnamedplus(vim.v.event.regcontents)
|
||||||
|
local copy_to_unnamed = require('vim.ui.clipboard.osc52').copy '*'
|
||||||
|
copy_to_unnamed(vim.v.event.regcontents)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<space>st', function()
|
||||||
|
vim.cmd.vnew()
|
||||||
|
vim.cmd.term()
|
||||||
|
vim.cmd.wincmd 'J'
|
||||||
|
vim.api.nvim_win_set_height(0, 15)
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
'n',
|
||||||
|
'K', -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||||
|
function()
|
||||||
|
vim.cmd.RustLsp { 'hover', 'actions' }
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap('t', '<C-Space>', '<C-\\><C-n>', { noremap = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('Filetype', {
|
||||||
|
pattern = 'terraform',
|
||||||
|
callback = function()
|
||||||
|
vim.bo.commentstring = '# %s'
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require('lazy').setup {
|
||||||
|
|
||||||
|
{
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
config = true,
|
||||||
|
-- use opts = {} for passing setup options
|
||||||
|
-- this is equivalent to setup({}) function
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'mrcjkb/rustaceanvim',
|
||||||
|
version = '^6', -- Recommended
|
||||||
|
lazy = false, -- This plugin is already lazy
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue