Many changes

This commit is contained in:
Jesper Fussing Mørk 2022-10-12 09:33:11 +02:00
parent d47ae6c9a7
commit 292483234d
7 changed files with 266 additions and 20 deletions

View File

@ -1,7 +1,8 @@
require('plugins')
require('visuals')
require('handling')
require('completion')
require('python')
require('development')
require('keybindings')
vim.opt.tabstop = 2
@ -10,3 +11,5 @@ vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.clipboard = 'unnamedplus'
vim.opt.smartindent = true
vim.opt.swapfile = false
vim.opt.signcolumn = "yes"

View File

@ -0,0 +1,60 @@
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
require'lspconfig'.pyright.setup{
capabilities = capabilities,
}
require('dap-python').setup('~/.local/share/virtualenvs/debugpy/bin/python')
require('dap-python').test_runner = 'pytest'
require("neotest").setup({
output = {
enabled = true,
open_on_run = "yes",
},
adapters = {
require("neotest-python")({
dap = { justMyCode = false },
args = {"--cov=src", "--cov-report=term-missing"},
runner = 'pytest',
}),
require("neotest-plenary"),
},
})
require("dapui").setup({
layouts = {
{
elements = {
-- Elements can be strings or table with id and size keys.
{ id = "scopes", size = 0.25 },
"breakpoints",
"watches",
},
size = 40, -- 40 columns
position = "right",
}
},
})
require("nvim-dap-virtual-text").setup()
require("coverage").setup({
commands = true, -- create commands
highlights = {
-- customize highlight groups created by the plugin
covered = { fg = "#C3E88D" }, -- supports style, fg, bg, sp (see :h highlight-gui)
uncovered = { fg = "#F07178" },
},
signs = {
-- use your own highlight groups or text markers
covered = { hl = "CoverageCovered", text = "" },
uncovered = { hl = "CoverageUncovered", text = "" },
},
summary = {
-- customize the summary pop-up
min_coverage = 80.0, -- minimum coverage threshold (used for highlighting)
},
lang = {
-- customize language specific settings
},
})

View File

@ -0,0 +1,3 @@
require('leap').set_default_keymaps()
require('litee.lib').setup()
require('litee.gh').setup()

View File

@ -1,12 +1,141 @@
vim.g.mapleader = "½"
--FILEHANDLING
vim.api.nvim_set_keymap('n', '<M-1>',
"<cmd>lua require('fzf-lua').files()<CR>",
"<cmd>lua require('telescope.builtin').find_files()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<M-2>',
"<cmd>lua require('fzf-lua').buffers()<CR>",
"<cmd>lua require('telescope.builtin').buffers()<CR>",
{ noremap = true, silent = true }
)
--TESTING
vim.api.nvim_set_keymap('n', '<F10>',
"<cmd>lua require('neotest').output.open()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F58>',
"<cmd>lua require('neotest').summary.toggle()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F34>',
"<cmd>lua require('neotest').run.run()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F22>',
"<cmd>lua require('neotest').run.run(vim.fn.expand('%'))<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F46>',
"<cmd>lua require('neotest').run.run('tests/')<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F11>',
"<cmd>lua require('coverage').load(true)<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F59>',
"<cmd>lua require('coverage').summary()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F35>',
"<cmd>lua require('coverage').toggle()<CR>",
{ noremap = true, silent = true }
)
--DEBUGGING
vim.api.nvim_set_keymap('n', '<C-b>',
"<cmd>lua require('dap').toggle_breakpoint()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F57>',
"<cmd>lua require('dapui').toggle()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F45>',
"<cmd>lua require('dap').continue()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F33>',
"<cmd>lua require('dap-python').test_method()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F8>',
"<cmd>lua require('dap').step_over()<CR>",
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap('n', '<F32>',
"<cmd>lua require('dap').step_into()<CR>",
{ noremap = true, silent = true }
)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<C-J>', '<C-W><C-J>', { noremap = true, silent = true })
vim.keymap.set('n', '<C-K>', '<C-W><C-K>', { noremap = true, silent = true })
vim.keymap.set('n', '<C-L>', '<C-W><C-L>', { noremap = true, silent = true })
vim.keymap.set('n', '<C-H>', '<C-W><C-H>', { noremap = true, silent = true })
vim.keymap.set("n", "<F12>", "<cmd>TroubleToggle document_diagnostics<cr>",
{silent = true, noremap = true}
)
vim.keymap.set('n', '<F5>', "<cmd>lua require('github-notifications.menu').notifications()<CR>", { noremap = true, silent = true })
-- WHICH KEY
local wk = require("which-key")
wk.register({
g = {
name = "+Git",
h = {
name = "+Github",
c = {
name = "+Commits",
c = { "<cmd>GHCloseCommit<cr>", "Close" },
e = { "<cmd>GHExpandCommit<cr>", "Expand" },
o = { "<cmd>GHOpenToCommit<cr>", "Open To" },
p = { "<cmd>GHPopOutCommit<cr>", "Pop Out" },
z = { "<cmd>GHCollapseCommit<cr>", "Collapse" },
},
i = {
name = "+Issues",
p = { "<cmd>GHPreviewIssue<cr>", "Preview" },
},
l = {
name = "+Litee",
t = { "<cmd>LTPanel<cr>", "Toggle Panel" },
},
r = {
name = "+Review",
b = { "<cmd>GHStartReview<cr>", "Begin" },
c = { "<cmd>GHCloseReview<cr>", "Close" },
d = { "<cmd>GHDeleteReview<cr>", "Delete" },
e = { "<cmd>GHExpandReview<cr>", "Expand" },
s = { "<cmd>GHSubmitReview<cr>", "Submit" },
z = { "<cmd>GHCollapseReview<cr>", "Collapse" },
},
p = {
name = "+Pull Request",
c = { "<cmd>GHClosePR<cr>", "Close" },
d = { "<cmd>GHPRDetails<cr>", "Details" },
e = { "<cmd>GHExpandPR<cr>", "Expand" },
o = { "<cmd>GHOpenPR<cr>", "Open" },
p = { "<cmd>GHPopOutPR<cr>", "PopOut" },
r = { "<cmd>GHRefreshPR<cr>", "Refresh" },
t = { "<cmd>GHOpenToPR<cr>", "Open To" },
z = { "<cmd>GHCollapsePR<cr>", "Collapse" },
},
t = {
name = "+Threads",
c = { "<cmd>GHCreateThread<cr>", "Create" },
n = { "<cmd>GHNextThread<cr>", "Next" },
t = { "<cmd>GHToggleThread<cr>", "Toggle" },
},
},
},
}, { prefix = "<leader>" })

View File

@ -3,17 +3,52 @@ return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
-- Visuals
use 'shaunsingh/nord.nvim'
use 'kyazdani42/nvim-web-devicons'
use {
'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
-- File Handling
use { 'ibhagwan/fzf-lua',
requires = { 'kyazdani42/nvim-web-devicons' }
use 'cocopon/iceberg.vim'
use {
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
}
use {
'rlch/github-notifications.nvim',
config = [[require('config.github-notifications')]],
requires = {
'nvim-lua/plenary.nvim',
'nvim-telescope/telescope.nvim',
},
}
-- Handling
use {
'nvim-telescope/telescope.nvim', tag = '0.1.0',
requires = { {'nvim-lua/plenary.nvim'} }
}
use 'ggandor/leap.nvim'
use {
'ldelossa/gh.nvim',
requires = { { 'ldelossa/litee.nvim' } }
}
use {
"folke/which-key.nvim",
config = function()
require("which-key").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
}
-- Completion
use 'github/copilot.vim'
@ -34,6 +69,27 @@ return require('packer').startup(function(use)
}
use 'hrsh7th/cmp-nvim-lsp'
-- Python
-- Development
use 'neovim/nvim-lspconfig'
use 'mfussenegger/nvim-dap'
use 'mfussenegger/nvim-dap-python'
use 'rcarriga/nvim-dap-ui'
use 'theHamsta/nvim-dap-virtual-text'
use {
"nvim-neotest/neotest",
requires = {
"nvim-neotest/neotest-python",
"nvim-neotest/neotest-plenary",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim"
}
}
use({
"andythigpen/nvim-coverage",
requires = "nvim-lua/plenary.nvim",
-- config = function()
-- require("user.coverage")
-- end,
})
end)

View File

@ -1,6 +0,0 @@
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
require'lspconfig'.pyright.setup{
capabilities = capabilities,
}

View File

@ -1,10 +1,10 @@
vim.opt.termguicolors = true
vim.cmd[[colorscheme nord]]
vim.cmd[[colorscheme iceberg]]
require('lualine').setup {
options = {
icons_enabled = false,
theme = 'nord',
icons_enabled = true,
theme = 'iceberg_dark',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
@ -22,9 +22,9 @@ require('lualine').setup {
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_b = {'branch', 'diff', 'diagnostics', require('github-notifications').statusline_notification_count},
lualine_c = {'filename'},
lualine_x = {'encoding', 'filetype'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
@ -41,3 +41,4 @@ require('lualine').setup {
inactive_winbar = {},
extensions = {}
}
require('telescope').load_extension('ghn')