chore: run stylua

This commit is contained in:
Matej Janezic 2023-03-27 14:42:59 +02:00
parent 15770ed51a
commit adb41f63b0
Signed by: janezicmatej
GPG Key ID: 4298E230ED37B2C0
7 changed files with 87 additions and 88 deletions

View File

@ -1,10 +1,7 @@
vim.api.nvim_create_autocmd({ "BufEnter, BufWinEnter" },
{ command = "set colorcolumn=120,80,88", pattern = { "*.py", "*.pyi" } })
vim.api.nvim_create_autocmd({ "BufEnter, BufWinEnter" },
{ command = "set colorcolumn=80,100", pattern = { "*.rs" } })
vim.api.nvim_create_autocmd({ "BufEnter, BufWinEnter" },
{ command = "set splitright", pattern = { "*" } })
vim.api.nvim_create_autocmd({ "BufEnter, BufWinEnter" },
{ command = "set splitbelow", pattern = { "*" } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' },
{ command = 'set colorcolumn=120,80,88', pattern = { '*.py', '*.pyi' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set colorcolumn=80,100', pattern = { '*.rs' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitright', pattern = { '*' } })
vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitbelow', pattern = { '*' } })
return {}

View File

@ -31,6 +31,9 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
-- Plugins
vim.keymap.set('n', '<leader>nb', ":Navbuddy<CR>", { desc = '[N]av[b]uddy' })
-- terminal keymaps
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
@ -43,7 +46,6 @@ end
--
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
vim.cmd 'autocmd! TermOpen term://* lua set_terminal_keymaps()'
return {}

View File

@ -1,5 +1,6 @@
function leave_snippet()
if ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i')
if
((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i')
and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()]
and not require('luasnip').session.jump_active
then
@ -20,7 +21,7 @@ local border = {
vim.api.nvim_command [[
autocmd ModeChanged * lua leave_snippet()
]])
]]
return {
{
@ -30,17 +31,18 @@ return {
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
{ -- copilot
{
-- copilot
'zbirenbaum/copilot.lua',
opts = { suggestion = { enabled = false }, panel = { enabled = false } }
opts = { suggestion = { enabled = false }, panel = { enabled = false } },
},
{ -- copilot-cmp source
{
-- copilot-cmp source
'zbirenbaum/copilot-cmp',
opts = { clear_after_cursor = true }
}
opts = { clear_after_cursor = true },
},
},
config = function()
-- nvim-cmp setup
local cmp = require 'cmp'
@ -55,7 +57,7 @@ return {
end,
},
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs( -4),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
@ -74,8 +76,8 @@ return {
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable( -1) then
luasnip.jump( -1)
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
@ -92,6 +94,6 @@ return {
},
},
}
end
end,
},
}

View File

@ -2,7 +2,6 @@ return {
-- NOTE: Theme
{
'sainnhe/gruvbox-material',
priority = 1000,
config = function()
vim.g.gruvbox_material_background = 'soft'
@ -31,29 +30,30 @@ return {
{ 'numToStr/Comment.nvim', opts = {} },
-- colorize in files
{ "norcalli/nvim-colorizer.lua", opts = {} },
{ 'norcalli/nvim-colorizer.lua', opts = {} },
-- highlighting for comments
{ "folke/todo-comments.nvim", dependencies = "nvim-lua/plenary.nvim", opts = {} },
{ 'folke/todo-comments.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} },
-- markdown preview using glow
{ "ellisonleao/glow.nvim", config = true, cmd = "Glow" },
{ 'ellisonleao/glow.nvim', config = true, cmd = 'Glow' },
-- permanent links to fileranges
{ 'ruifm/gitlinker.nvim',
config = function()
require('gitlinker').setup(
{
'ruifm/gitlinker.nvim',
config = function()
require('gitlinker').setup {
callbacks = {
['git.aflabs.org'] = require('gitlinker.hosts').get_gitlab_type_url }
['git.aflabs.org'] = require('gitlinker.hosts').get_gitlab_type_url,
},
}
)
end
end,
},
-- NOTE: Third, plugins that require some setup, but not enugh for separate file
{ -- Adds git releated signs to the gutter, as well as utilities for managing changes
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
@ -67,7 +67,8 @@ return {
},
},
{ -- Set lualine as statusline
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
@ -81,7 +82,8 @@ return {
},
},
{ -- Add indentation guides even on blank lines
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
@ -91,38 +93,39 @@ return {
},
},
{ -- git blame annotations
{
-- git blame annotations
'f-person/git-blame.nvim',
config = function()
vim.api.nvim_set_keymap('n', '<leader>gt', ':GitBlameToggle<CR>', { desc = '[G]it Blame [T]oggle', noremap = true })
vim.api.nvim_set_keymap('n', '<leader>gu', ':GitBlameOpenCommitURL<CR>',
{ desc = '[G]it Blame Open Commit [U]rl', noremap = true })
end
end,
},
{ -- a more adventurous wildmenu
{
-- a more adventurous wildmenu
'gelguy/wilder.nvim',
dependencies = { 'romgrk/fzy-lua-native' },
config = function()
local wilder = require('wilder')
wilder.setup({ modes = { ':', '/', '?' } })
local wilder = require 'wilder'
wilder.setup { modes = { ':', '/', '?' } }
-- Disable Python remote plugin
wilder.set_option('use_python_remote_plugin', 0)
wilder.set_option('pipeline', {
wilder.branch(
wilder.cmdline_pipeline({
wilder.cmdline_pipeline {
fuzzy = 1,
fuzzy_filter = wilder.lua_fzy_filter(),
}),
},
wilder.vim_search_pipeline()
)
),
})
wilder.set_option('renderer', wilder.popupmenu_renderer(
wilder.popupmenu_border_theme({
wilder.set_option(
'renderer',
wilder.popupmenu_renderer(wilder.popupmenu_border_theme {
highlights = {
border = 'Normal',
},
@ -131,21 +134,22 @@ return {
left = { ' ', wilder.popupmenu_devicons() },
right = { ' ', wilder.popupmenu_scrollbar() },
})
))
)
end,
},
{ -- file tree
"nvim-neo-tree/neo-tree.nvim",
version = "*",
{
-- file tree
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
config = function()
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
vim.cmd [[ let g:neo_tree_remove_legacy_commands = 1 ]]
require('neo-tree').setup {
filesystem = {
@ -154,7 +158,7 @@ return {
hide_dotfiles = false,
hide_gitignored = false,
},
}
},
}
end,
},

View File

@ -1,6 +1,6 @@
-- LSP settings.
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
local on_attach = function(client, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
@ -16,7 +16,7 @@ local on_attach = function(_, bufnr)
end
local delayed_format = function()
vim.lsp.buf.format({ timeout_ms = 2000 })
vim.lsp.buf.format { timeout_ms = 2000 }
end
require('nvim-navbuddy').attach(client, bufnr)
@ -51,7 +51,8 @@ local on_attach = function(_, bufnr)
end
return {
{ -- LSP Configuration & Plugins
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
@ -73,11 +74,10 @@ return {
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
config = function()
local servers = {
-- clangd = {},
-- gopls = {},
clangd = {},
gopls = {},
marksman = {},
pyright = {},
tsserver = {},
@ -116,18 +116,17 @@ return {
}
end,
}
end
end,
},
{ -- inject lsp formatting, diagonstics etc
{
-- inject lsp formatting, diagonstics etc
'jose-elias-alvarez/null-ls.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local null_ls = require("null-ls")
local null_ls = require 'null-ls'
null_ls.setup({
null_ls.setup {
sources = {
-- general
null_ls.builtins.code_actions.gitsigns,
@ -137,10 +136,10 @@ return {
null_ls.builtins.formatting.isort,
-- typescript
null_ls.builtins.formatting.prettier,
-- rust
-- null_ls.builtins.formatting.rustfmt,
-- lua
null_ls.builtins.formatting.stylua,
},
})
end
}
end,
},
}

View File

@ -1,9 +1,8 @@
return {
{ -- Fuzzy Finder (files, lsp, etc)
{
-- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
@ -18,7 +17,6 @@ return {
end,
},
},
config = function()
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
@ -33,8 +31,8 @@ return {
},
pickers = {
find_files = {
find_command = { "rg", "-S", "--no-ignore-vcs", "--hidden", "--files", "-g", "!.git", },
}
find_command = { 'rg', '-S', '--no-ignore-vcs', '--hidden', '--files', '-g', '!.git' },
},
},
}
@ -60,17 +58,16 @@ return {
vim.keymap.set('n', '<leader>ss', require('telescope.builtin').spell_suggest, { desc = '[S]pell [S]suggest' })
vim.keymap.set('n', '<leader>sc', function()
require('telescope.builtin').colorscheme({ enable_preview = true })
require('telescope.builtin').colorscheme { enable_preview = true }
end, { desc = '[S]earch [C]olorscheme' })
-- extensions
-- vim.keymap.set('n', '<leader>fb', require('telescope').extensions.file_browser.file_browser, { desc = '[F]ile [B]rowser' })
vim.api.nvim_set_keymap('n', '<leader>tc', ':TodoTelescope<CR>', { desc = '[T]odo [C]omments', noremap = true })
end
end,
},
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
}

View File

@ -1,5 +1,4 @@
return {
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
@ -80,6 +79,5 @@ return {
},
},
}
end,
}