Reformat all neovim configuration files with stylua
This commit is contained in:
parent
d69a00df7e
commit
bddcb64be8
16 changed files with 414 additions and 352 deletions
|
@ -24,10 +24,14 @@ fi
|
|||
staged_lua=$(echo "$staged_files" | grep '.lua$' || true)
|
||||
num_staged_lua=$(echo "$staged_lua" | grep -vce '^$' || true)
|
||||
if [ "$num_staged_lua" -gt 0 ]; then
|
||||
printf '\nFormatting %s staged Lua files with lua-format\n' "$num_staged_lua"
|
||||
stylua "$staged_lua"
|
||||
printf '\nFormatting %s staged Lua files with stylua\n' "$num_staged_lua"
|
||||
|
||||
for file in $staged_lua;do
|
||||
stylua "$file"
|
||||
done
|
||||
|
||||
printf "Re-staging\n\n"
|
||||
git add "$staged_lua"
|
||||
git add $staged_lua
|
||||
fi
|
||||
|
||||
# Run shfmt on staged shell scripts
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
require('keybinds')
|
||||
require('settings')
|
||||
require('plugins.init')
|
||||
require("keybinds")
|
||||
require("settings")
|
||||
require("plugins.init")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
local map = vim.keymap.set
|
||||
|
||||
-- Navigate between buffers
|
||||
map('n', '<C-N>', vim.cmd.bn, {silent = true})
|
||||
map('n', '<C-B>', vim.cmd.bp, {silent = true})
|
||||
map("n", "<C-N>", vim.cmd.bn, { silent = true })
|
||||
map("n", "<C-B>", vim.cmd.bp, { silent = true })
|
||||
|
||||
-- Run Neoformat
|
||||
map('n', '<M-f>', vim.cmd.Neoformat, {})
|
||||
map("n", "<M-f>", vim.cmd.Neoformat, {})
|
||||
|
||||
-- Exit terminal insert mode with esc
|
||||
map('t', '<Esc>', '<C-\\><C-n>', {})
|
||||
map("t", "<Esc>", "<C-\\><C-n>", {})
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
-- Settings for pager mode
|
||||
vim.keymap.set('n', 'q', vim.cmd.q)
|
||||
vim.keymap.set("n", "q", vim.cmd.q)
|
||||
|
|
|
@ -1,29 +1,35 @@
|
|||
return function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
if not cmp then return end
|
||||
if not cmp then
|
||||
return
|
||||
end
|
||||
|
||||
-- Setup git completion source
|
||||
require("cmp_git").setup()
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
vim.o.completeopt = "menuone,noselect"
|
||||
|
||||
cmp.setup {
|
||||
snippet = {expand = function(args) luasnip.lsp_expand(args.body) end},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
['<Tab>'] = function(fallback)
|
||||
mapping = {
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.close(),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
|
@ -32,7 +38,7 @@ return function()
|
|||
fallback()
|
||||
end
|
||||
end,
|
||||
['<S-Tab>'] = function(fallback)
|
||||
["<S-Tab>"] = function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
|
@ -40,17 +46,20 @@ return function()
|
|||
else
|
||||
fallback()
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{name = 'buffer'}, {name = 'git'}, {name = 'luasnip'},
|
||||
{name = 'nvim_lsp'}, {name = 'nvim_lua'}, {name = 'path'}
|
||||
}
|
||||
}
|
||||
{ name = "buffer" },
|
||||
{ name = "git" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable autopairs when enter is processed
|
||||
-- on completion
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
return function()
|
||||
vim.opt.list = true
|
||||
require('indent_blankline').setup {
|
||||
space_char_blankline = ' ',
|
||||
require("indent_blankline").setup({
|
||||
space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
show_current_context_start = true
|
||||
}
|
||||
show_current_context_start = true,
|
||||
})
|
||||
end
|
||||
|
|
|
@ -1,202 +1,219 @@
|
|||
local fn = vim.fn
|
||||
|
||||
-- Install packer if it's not yet installed
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
print('Installing Packer')
|
||||
print("Installing Packer")
|
||||
Packer_bootstrap = fn.system({
|
||||
'git', 'clone', '--depth', '1',
|
||||
'https://github.com/wbthomason/packer.nvim', install_path
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
print('Installed Packer')
|
||||
vim.cmd([[packadd packer.nvim]])
|
||||
print("Installed Packer")
|
||||
end
|
||||
|
||||
-- Configure packer
|
||||
require('packer').startup(function()
|
||||
local use = require('packer').use
|
||||
require("packer").startup(function()
|
||||
local use = require("packer").use
|
||||
|
||||
-- The plugin manager itself
|
||||
use {'wbthomason/packer.nvim'}
|
||||
use({ "wbthomason/packer.nvim" })
|
||||
|
||||
-- Colorscheme
|
||||
use {
|
||||
'rebelot/kanagawa.nvim',
|
||||
config = function() vim.cmd('colorscheme kanagawa') end
|
||||
}
|
||||
use({
|
||||
"rebelot/kanagawa.nvim",
|
||||
config = function()
|
||||
vim.cmd("colorscheme kanagawa")
|
||||
end,
|
||||
})
|
||||
|
||||
-- Statusline
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
||||
config = require('plugins.lualine')
|
||||
}
|
||||
use({
|
||||
"nvim-lualine/lualine.nvim",
|
||||
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
||||
config = require("plugins.lualine"),
|
||||
})
|
||||
|
||||
-- Startup screen/dashboard
|
||||
--use 'glepnir/dashboard-nvim'
|
||||
|
||||
-- Git in signcolumn
|
||||
use 'airblade/vim-gitgutter'
|
||||
use("airblade/vim-gitgutter")
|
||||
|
||||
-- Tabline/bufferline
|
||||
use {
|
||||
'akinsho/nvim-bufferline.lua',
|
||||
tag = '*',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
config = function() require('bufferline').setup {} end
|
||||
}
|
||||
use({
|
||||
"akinsho/nvim-bufferline.lua",
|
||||
tag = "*",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
config = function()
|
||||
require("bufferline").setup({})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Git commands
|
||||
use 'tpope/vim-fugitive'
|
||||
use("tpope/vim-fugitive")
|
||||
|
||||
-- Indent characters
|
||||
use {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
config = require('plugins.indent-blankline')
|
||||
}
|
||||
use({
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
config = require("plugins.indent-blankline"),
|
||||
})
|
||||
|
||||
-- Tree explorer
|
||||
use {
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
config = require('plugins.nvim-tree')
|
||||
}
|
||||
use({
|
||||
"kyazdani42/nvim-tree.lua",
|
||||
requires = "kyazdani42/nvim-web-devicons",
|
||||
config = require("plugins.nvim-tree"),
|
||||
})
|
||||
|
||||
-- Telescope
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = require('plugins.telescope'),
|
||||
use({
|
||||
"nvim-telescope/telescope.nvim",
|
||||
config = require("plugins.telescope"),
|
||||
requires = {
|
||||
{'nvim-lua/plenary.nvim'}, -- Internal dep for telescope
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', run = 'make'}, -- Use fzf for fuzzy finder
|
||||
{'nvim-telescope/telescope-ui-select.nvim'}, -- Replace vim built in select with telescope
|
||||
{'zane-/cder.nvim'}, -- cd plugin for telescope
|
||||
}
|
||||
}
|
||||
{ "nvim-lua/plenary.nvim" }, -- Internal dep for telescope
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }, -- Use fzf for fuzzy finder
|
||||
{ "nvim-telescope/telescope-ui-select.nvim" }, -- Replace vim built in select with telescope
|
||||
{ "zane-/cder.nvim" }, -- cd plugin for telescope
|
||||
},
|
||||
})
|
||||
|
||||
-- Do stuff as sudo
|
||||
use 'lambdalisue/suda.vim'
|
||||
use("lambdalisue/suda.vim")
|
||||
|
||||
-- Display possible keybinds
|
||||
use {'folke/which-key.nvim', config = require('plugins.which-key')}
|
||||
use({ "folke/which-key.nvim", config = require("plugins.which-key") })
|
||||
|
||||
-- Read editorconfig settings
|
||||
use 'editorconfig/editorconfig-vim'
|
||||
use("editorconfig/editorconfig-vim")
|
||||
|
||||
-- Package manager for LSP servers, DAP servers etc.
|
||||
use {'williamboman/mason.nvim', config = require('plugins.mason').setup}
|
||||
use({ "williamboman/mason.nvim", config = require("plugins.mason").setup })
|
||||
|
||||
-- Install LSP server executables with Mason
|
||||
use {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
config = require('plugins.mason').lspconfig_setup
|
||||
}
|
||||
use({
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = require("plugins.mason").lspconfig_setup,
|
||||
})
|
||||
|
||||
-- Configs for built-in LSP
|
||||
use {'neovim/nvim-lspconfig', config = require('plugins.lspconfig').setup}
|
||||
use({ "neovim/nvim-lspconfig", config = require("plugins.lspconfig").setup })
|
||||
|
||||
-- Additional LSP features for Java
|
||||
use 'mfussenegger/nvim-jdtls'
|
||||
use("mfussenegger/nvim-jdtls")
|
||||
|
||||
-- Display function signature
|
||||
use 'ray-x/lsp_signature.nvim'
|
||||
use("ray-x/lsp_signature.nvim")
|
||||
|
||||
-- Snippets plugin
|
||||
use {
|
||||
'L3MON4D3/LuaSnip',
|
||||
requires = {'rafamadriz/friendly-snippets'}, -- Snippets collection
|
||||
config = require('plugins.luasnip')
|
||||
}
|
||||
use({
|
||||
"L3MON4D3/LuaSnip",
|
||||
requires = { "rafamadriz/friendly-snippets" }, -- Snippets collection
|
||||
config = require("plugins.luasnip"),
|
||||
})
|
||||
|
||||
-- vim api documentation for lua lsp
|
||||
use {'ii14/emmylua-nvim'}
|
||||
use({ "ii14/emmylua-nvim" })
|
||||
|
||||
-- Completion
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
use({
|
||||
"hrsh7th/nvim-cmp",
|
||||
requires = {
|
||||
{'hrsh7th/cmp-buffer'}, -- Buffer source
|
||||
{'petertriho/cmp-git', requires = 'nvim-lua/plenary.nvim'}, -- Git source
|
||||
{'hrsh7th/cmp-nvim-lsp'}, -- LSP source
|
||||
{'hrsh7th/cmp-nvim-lua'}, -- Neovim Lua API documentation source
|
||||
{'hrsh7th/cmp-path'}, -- Path source
|
||||
{'saadparwaiz1/cmp_luasnip'} -- Snippets source
|
||||
{ "hrsh7th/cmp-buffer" }, -- Buffer source
|
||||
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" }, -- Git source
|
||||
{ "hrsh7th/cmp-nvim-lsp" }, -- LSP source
|
||||
{ "hrsh7th/cmp-nvim-lua" }, -- Neovim Lua API documentation source
|
||||
{ "hrsh7th/cmp-path" }, -- Path source
|
||||
{ "saadparwaiz1/cmp_luasnip" }, -- Snippets source
|
||||
},
|
||||
config = require('plugins.cmp')
|
||||
}
|
||||
config = require("plugins.cmp"),
|
||||
})
|
||||
|
||||
-- Automatic brackets
|
||||
use {
|
||||
'windwp/nvim-autopairs',
|
||||
config = function() require('nvim-autopairs').setup {} end
|
||||
}
|
||||
use({
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup({})
|
||||
end,
|
||||
})
|
||||
|
||||
-- treesitter
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
require('nvim-treesitter.install').update({with_sync = true})
|
||||
require("nvim-treesitter.install").update({ with_sync = true })
|
||||
end,
|
||||
config = require('plugins.treesitter')
|
||||
}
|
||||
config = require("plugins.treesitter"),
|
||||
})
|
||||
|
||||
-- treesitter plugin for commentstring
|
||||
use 'JoosepAlviste/nvim-ts-context-commentstring'
|
||||
use("JoosepAlviste/nvim-ts-context-commentstring")
|
||||
|
||||
-- Additional plugins for formats not supported
|
||||
-- by treesitter
|
||||
use 'jamespeapen/swayconfig.vim'
|
||||
use("jamespeapen/swayconfig.vim")
|
||||
|
||||
-- mappings for commenting in code
|
||||
use 'tpope/vim-commentary'
|
||||
use("tpope/vim-commentary")
|
||||
|
||||
-- we all know this one
|
||||
use 'tpope/vim-surround'
|
||||
use("tpope/vim-surround")
|
||||
|
||||
-- Formatter plugin
|
||||
use 'sbdchd/neoformat'
|
||||
use("sbdchd/neoformat")
|
||||
|
||||
-- Make editing passwords safer
|
||||
use {
|
||||
'https://git.zx2c4.com/password-store',
|
||||
rtp = 'contrib/vim/redact_pass.vim'
|
||||
}
|
||||
use({
|
||||
"https://git.zx2c4.com/password-store",
|
||||
rtp = "contrib/vim/redact_pass.vim",
|
||||
})
|
||||
|
||||
-- Neovim inside Firefox
|
||||
use {
|
||||
'glacambre/firenvim',
|
||||
run = function() vim.fn['firenvim#install'](0) end
|
||||
}
|
||||
use({
|
||||
"glacambre/firenvim",
|
||||
run = function()
|
||||
vim.fn["firenvim#install"](0)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Vim <3 Asciidoctor
|
||||
use 'habamax/vim-asciidoctor'
|
||||
use("habamax/vim-asciidoctor")
|
||||
|
||||
-- Markdown preview
|
||||
use({
|
||||
'iamcco/markdown-preview.nvim',
|
||||
run = 'cd app && npm install',
|
||||
setup = function() vim.g.mkdp_filetypes = {'markdown'} end,
|
||||
ft = {'markdown'}
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = "cd app && npm install",
|
||||
setup = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
})
|
||||
|
||||
-- Edit GPG encrypted files transparently
|
||||
use 'jamessan/vim-gnupg'
|
||||
use("jamessan/vim-gnupg")
|
||||
|
||||
-- High performance color highlighter
|
||||
use {
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
config = function() require('colorizer').setup() end
|
||||
}
|
||||
use({
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
-- If Packer was just installed,
|
||||
-- sync plugins
|
||||
if Packer_bootstrap then require('packer').sync() end
|
||||
|
||||
if Packer_bootstrap then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
|
||||
-- Sync plugins if Packer was just
|
||||
-- installed
|
||||
if Packer_bootstrap then
|
||||
print('Syncing plugins')
|
||||
require('packer').sync()
|
||||
print("Syncing plugins")
|
||||
require("packer").sync()
|
||||
end
|
||||
|
|
|
@ -14,20 +14,20 @@ Servers = {
|
|||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT'
|
||||
version = "LuaJIT",
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {'vim'}
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file('', true)
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {enable = false}
|
||||
}
|
||||
}
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
M = {}
|
||||
|
@ -35,16 +35,16 @@ M = {}
|
|||
function M.map_keys()
|
||||
-- Register keybindings via which-key
|
||||
-- to get documentation in which-key
|
||||
local wk = require('which-key')
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
g = {
|
||||
name = "Go to",
|
||||
d = { vim.lsp.buf.definition, "Definition" },
|
||||
D = { vim.lsp.buf.declaration, "Declaration" },
|
||||
i = { vim.lsp.buf.implementation, "Implementation" },
|
||||
r = {vim.lsp.buf.references, "References"}
|
||||
r = { vim.lsp.buf.references, "References" },
|
||||
},
|
||||
['<leader>'] = {
|
||||
["<leader>"] = {
|
||||
name = "Leader",
|
||||
w = {
|
||||
name = "Workspace",
|
||||
|
@ -53,43 +53,42 @@ function M.map_keys()
|
|||
l = {
|
||||
function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, "List folders"
|
||||
}
|
||||
end,
|
||||
"List folders",
|
||||
},
|
||||
},
|
||||
D = { vim.lsp.buf.type_definition, "Type definition" },
|
||||
rn = { vim.lsp.buf.rename, "Rename symbol" },
|
||||
ca = { vim.lsp.buf.code_action, "Code action" },
|
||||
e = { vim.diagnostic.open_float, "Open diagnostics" },
|
||||
f = {vim.lsp.buf.format, "Format"}
|
||||
f = { vim.lsp.buf.format, "Format" },
|
||||
},
|
||||
K = { vim.lsp.buf.hover, "Hover" },
|
||||
['['] = {d = {vim.diagnostic.goto_prev, "Previous diagnostic"}},
|
||||
[']'] = {d = {vim.diagnostic.goto_next, "Next diagnostic"}}
|
||||
|
||||
["["] = { d = { vim.diagnostic.goto_prev, "Previous diagnostic" } },
|
||||
["]"] = { d = { vim.diagnostic.goto_next, "Next diagnostic" } },
|
||||
})
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
|
||||
local function on_attach()
|
||||
-- Setup lsp signature plugin
|
||||
require('lsp_signature').setup {}
|
||||
require("lsp_signature").setup({})
|
||||
|
||||
-- Setup keybinds
|
||||
M.map_keys()
|
||||
end
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- Setup every defined server
|
||||
for server, settings in pairs(Servers) do
|
||||
require('lspconfig')[server].setup {
|
||||
require("lspconfig")[server].setup({
|
||||
on_attach = on_attach,
|
||||
settings = settings,
|
||||
-- Inform lsp server about client
|
||||
-- capabilities
|
||||
capabilities = capabilities
|
||||
}
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
return function() require('lualine').setup {} end
|
||||
return function()
|
||||
require("lualine").setup({})
|
||||
end
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
return function()
|
||||
local luasnip = require('luasnip')
|
||||
local wk = require('which-key')
|
||||
local luasnip = require("luasnip")
|
||||
local wk = require("which-key")
|
||||
|
||||
-- load friendly-snippets to luasnip
|
||||
require('luasnip/loaders/from_vscode').lazy_load()
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
-- Register snippet navigation keybindings
|
||||
local snippet_mappings = {
|
||||
['<c-j>'] = {function()luasnip.jump(1) end},
|
||||
['<c-k>'] = {function() luasnip.jump(-1) end}
|
||||
["<c-j>"] = {
|
||||
function()
|
||||
luasnip.jump(1)
|
||||
end,
|
||||
},
|
||||
["<c-k>"] = {
|
||||
function()
|
||||
luasnip.jump(-1)
|
||||
end,
|
||||
},
|
||||
}
|
||||
--wk.register(snippet_mappings, {mode = "i"})
|
||||
--wk.register(snippet_mappings, {mode = "s"})
|
||||
|
|
|
@ -2,9 +2,12 @@ local M = {}
|
|||
|
||||
Opts = { mason = {}, lspconfig = { automatic_installation = true } }
|
||||
|
||||
M.setup = function() require('mason').setup(Opts.mason) end
|
||||
M.setup = function()
|
||||
require("mason").setup(Opts.mason)
|
||||
end
|
||||
|
||||
M.lspconfig_setup =
|
||||
function() require('mason-lspconfig').setup(Opts.lspconfig) end
|
||||
M.lspconfig_setup = function()
|
||||
require("mason-lspconfig").setup(Opts.lspconfig)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
return function()
|
||||
require("nvim-tree").setup { -- BEGIN_DEFAULT_OPTS
|
||||
require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
show_on_dirs = true,
|
||||
},
|
||||
renderer = {
|
||||
highlight_git = true
|
||||
}
|
||||
}
|
||||
highlight_git = true,
|
||||
},
|
||||
})
|
||||
-- Open/close with alt-o
|
||||
vim.keymap.set('n', '<M-o>', vim.cmd.NvimTreeToggle)
|
||||
vim.keymap.set("n", "<M-o>", vim.cmd.NvimTreeToggle)
|
||||
end
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
return function()
|
||||
local telescope = require('telescope')
|
||||
local builtin = require('telescope.builtin')
|
||||
local telescope = require("telescope")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
telescope.setup {
|
||||
pickers = {find_files = {find_command = {"fd", "-Ht", "f"}}}
|
||||
}
|
||||
telescope.setup({
|
||||
pickers = { find_files = { find_command = { "fd", "-Ht", "f" } } },
|
||||
})
|
||||
|
||||
telescope.load_extension('fzf')
|
||||
telescope.load_extension('ui-select')
|
||||
telescope.load_extension('cder')
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
||||
telescope.load_extension("cder")
|
||||
|
||||
-- Keybinds
|
||||
vim.keymap.set('n', '<C-t>', vim.cmd.Telescope)
|
||||
vim.keymap.set('n', '<C-f>', builtin.find_files)
|
||||
vim.keymap.set('n', '<C-g>', builtin.live_grep)
|
||||
vim.keymap.set("n", "<C-t>", vim.cmd.Telescope)
|
||||
vim.keymap.set("n", "<C-f>", builtin.find_files)
|
||||
vim.keymap.set("n", "<C-g>", builtin.live_grep)
|
||||
end
|
||||
|
|
|
@ -1,16 +1,36 @@
|
|||
return function()
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
'bash', 'c', 'css', 'dockerfile', 'html', 'http', 'java', 'json',
|
||||
'json5', 'latex', 'lua', 'make', 'markdown', 'php', 'python',
|
||||
'regex', 'rasi', 'rst', 'scss', 'toml', 'tsx', 'typescript',
|
||||
'javascript', 'yaml'
|
||||
"bash",
|
||||
"c",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"html",
|
||||
"http",
|
||||
"java",
|
||||
"json",
|
||||
"json5",
|
||||
"latex",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"php",
|
||||
"python",
|
||||
"regex",
|
||||
"rasi",
|
||||
"rst",
|
||||
"scss",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"yaml",
|
||||
},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = { enable = true },
|
||||
context_commentstring = {enable = true}
|
||||
}
|
||||
context_commentstring = { enable = true },
|
||||
})
|
||||
|
||||
-- vim.wo.foldmethod = 'expr'
|
||||
-- im.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
return function()
|
||||
require('which-key').setup {spelling = {enabled = true}}
|
||||
require("which-key").setup({ spelling = { enabled = true } })
|
||||
end
|
||||
|
|
|
@ -5,17 +5,17 @@ local g = vim.g
|
|||
o.termguicolors = true
|
||||
|
||||
-- Font for nvim GUI's
|
||||
o.guifont = 'Fira Code:h14'
|
||||
o.guifont = "Fira Code:h14"
|
||||
|
||||
-- Floating window transparency
|
||||
o.winblend = 10
|
||||
|
||||
-- Set window title
|
||||
o.title = true
|
||||
o.titlestring = 'NeoVim: ' .. vim.fn.getcwd()
|
||||
o.titlestring = "NeoVim: " .. vim.fn.getcwd()
|
||||
|
||||
-- Diff settings
|
||||
o.diffopt = 'filler,internal,algorithm:histogram,indent-heuristic'
|
||||
o.diffopt = "filler,internal,algorithm:histogram,indent-heuristic"
|
||||
|
||||
-- Allow switching buffers with unsaved changes
|
||||
o.hidden = true
|
||||
|
@ -24,9 +24,9 @@ o.hidden = true
|
|||
o.number = true
|
||||
|
||||
o.guicursor = table.concat({
|
||||
'i:ver1', -- Vertical bar cursor in insert mode
|
||||
'a:blinkon1' -- Blinking cursor in all modes
|
||||
}, ',')
|
||||
"i:ver1", -- Vertical bar cursor in insert mode
|
||||
"a:blinkon1", -- Blinking cursor in all modes
|
||||
}, ",")
|
||||
|
||||
-- Enable global statusline
|
||||
o.laststatus = 3
|
||||
|
|
Loading…
Reference in a new issue