mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-04-26 20:35:40 +00:00
Some more refactoring
This commit is contained in:
parent
71027962d3
commit
4e52b17959
20
.config/nvim/lua/halfdan/debugger/elixir.lua
Normal file
20
.config/nvim/lua/halfdan/debugger/elixir.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
local dap = require('dap')
|
||||||
|
|
||||||
|
dap.adapters.mix_task = {
|
||||||
|
type = 'executable',
|
||||||
|
command = '/Users/fbecker18/opt/elixir-ls/bin/debugger.sh', -- debugger.bat for windows
|
||||||
|
args = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.configurations.elixir = {
|
||||||
|
{
|
||||||
|
type = 'mix_task',
|
||||||
|
name = 'mix test',
|
||||||
|
request = 'launch',
|
||||||
|
task = 'test',
|
||||||
|
taskArgs = { '--trace' },
|
||||||
|
startApps = true,
|
||||||
|
projectDir = "${workspaceFolder}",
|
||||||
|
requireFiles = { "test/**/test_helper.exs", "test/**/*_test.exs"}
|
||||||
|
}
|
||||||
|
}
|
@ -37,7 +37,7 @@ dap.listeners.before.event_exited["dapui_config"] = function()
|
|||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- require("theprimeagen.debugger.node");
|
require("halfdan.debugger.elixir");
|
||||||
|
|
||||||
nnoremap("<Home>", function()
|
nnoremap("<Home>", function()
|
||||||
dapui.toggle(1)
|
dapui.toggle(1)
|
||||||
|
@ -9,6 +9,8 @@ require('halfdan.colorscheme')
|
|||||||
require('halfdan.treesitter')
|
require('halfdan.treesitter')
|
||||||
require('halfdan.telescope')
|
require('halfdan.telescope')
|
||||||
|
|
||||||
|
require('halfdan.lualine')
|
||||||
|
|
||||||
require('halfdan.themes.nord')
|
require('halfdan.themes.nord')
|
||||||
|
|
||||||
require('halfdan.autocmds')
|
require('halfdan.autocmds')
|
||||||
|
@ -4,128 +4,127 @@ local fn = vim.fn
|
|||||||
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
|
if fn.empty(fn.glob(install_path)) > 0 then
|
||||||
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
||||||
execute "packadd packer.nvim"
|
execute "packadd packer.nvim"
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Check if a file or directory exists in this path
|
--- Check if a file or directory exists in this path
|
||||||
local function require_plugin(plugin)
|
local function require_plugin(plugin)
|
||||||
local plugin_prefix = fn.stdpath("data") .. "/site/pack/packer/opt/"
|
local plugin_prefix = fn.stdpath("data") .. "/site/pack/packer/opt/"
|
||||||
|
|
||||||
local plugin_path = plugin_prefix .. plugin .. "/"
|
local plugin_path = plugin_prefix .. plugin .. "/"
|
||||||
-- print('test '..plugin_path)
|
-- print('test '..plugin_path)
|
||||||
local ok, err, code = os.rename(plugin_path, plugin_path)
|
local ok, err, code = os.rename(plugin_path, plugin_path)
|
||||||
if not ok then
|
if not ok then
|
||||||
if code == 13 then
|
if code == 13 then
|
||||||
-- Permission denied, but it exists
|
-- Permission denied, but it exists
|
||||||
return true
|
return true
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- print(ok, err, code)
|
end
|
||||||
if ok then
|
-- print(ok, err, code)
|
||||||
vim.cmd("packadd " .. plugin)
|
if ok then
|
||||||
end
|
vim.cmd("packadd " .. plugin)
|
||||||
return ok, err, code
|
end
|
||||||
|
return ok, err, code
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
||||||
|
|
||||||
return require("packer").startup(
|
return require("packer").startup(
|
||||||
function(use)
|
function(use)
|
||||||
-- Packer can manage itself as an optional plugin
|
-- Packer can manage itself as an optional plugin
|
||||||
use "wbthomason/packer.nvim"
|
use "wbthomason/packer.nvim"
|
||||||
|
|
||||||
use {'TimUntersberger/neogit' }
|
use {'TimUntersberger/neogit' }
|
||||||
use {'airblade/vim-gitgutter'}
|
use {'airblade/vim-gitgutter'}
|
||||||
-- use {'andymass/vim-matchup'}
|
-- use {'andymass/vim-matchup'}
|
||||||
|
|
||||||
-- Load .editorconfig files
|
-- Load .editorconfig files
|
||||||
use {'editorconfig/editorconfig-vim'}
|
use {'editorconfig/editorconfig-vim'}
|
||||||
|
|
||||||
use {'junegunn/vim-easy-align'}
|
use {'junegunn/vim-easy-align'}
|
||||||
|
|
||||||
-- Goodies
|
-- Goodies
|
||||||
use {'tpope/vim-fugitive'}
|
use {'tpope/vim-fugitive'}
|
||||||
use {'tpope/vim-surround'} -- ✅
|
use {'tpope/vim-surround'} -- ✅
|
||||||
use {'tpope/vim-dispatch'}
|
use {'tpope/vim-dispatch'}
|
||||||
|
|
||||||
-- Testing
|
-- Testing
|
||||||
use {'vim-test/vim-test'}
|
use {'vim-test/vim-test'}
|
||||||
|
|
||||||
|
-- Treesitter
|
||||||
|
use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
|
||||||
|
use {"nvim-treesitter/nvim-treesitter-textobjects"}
|
||||||
|
|
||||||
|
use {'preservim/tagbar'}
|
||||||
|
vim.g.tagbar_ctags_bin = '/usr/local/bin/ctags'
|
||||||
|
|
||||||
|
-- Status Line and Bufferline
|
||||||
|
use {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
requires = {'kyazdani42/nvim-web-devicons'}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
-- Treesitter
|
use {'justinmk/vim-sneak'}
|
||||||
use {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
|
|
||||||
use {"nvim-treesitter/nvim-treesitter-textobjects"}
|
|
||||||
|
|
||||||
use {'preservim/tagbar'}
|
use {'machakann/vim-highlightedyank'}
|
||||||
vim.g.tagbar_ctags_bin = '/usr/local/bin/ctags'
|
-- let g:highlightedyank_highlight_duration = 100
|
||||||
|
|
||||||
-- Status Line and Bufferline
|
-- LSP / Language Server Protocol
|
||||||
use {
|
use {
|
||||||
'nvim-lualine/lualine.nvim',
|
'neovim/nvim-lspconfig',
|
||||||
requires = {'kyazdani42/nvim-web-devicons'}
|
'williamboman/nvim-lsp-installer',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use {'hrsh7th/cmp-nvim-lsp'}
|
||||||
|
use {'hrsh7th/cmp-buffer'}
|
||||||
|
use {'hrsh7th/cmp-path'}
|
||||||
|
use {'hrsh7th/cmp-cmdline'}
|
||||||
|
use {'hrsh7th/nvim-cmp'}
|
||||||
|
use {'tzachar/cmp-tabnine', run = './install.sh'}
|
||||||
|
use {'onsails/lspkind-nvim'} -- Display symbol with cmp suggestions
|
||||||
|
use {'L3MON4D3/LuaSnip'}
|
||||||
|
use {'saadparwaiz1/cmp_luasnip'}
|
||||||
|
|
||||||
use {'justinmk/vim-sneak'}
|
use {'glepnir/lspsaga.nvim'}
|
||||||
|
|
||||||
use {'machakann/vim-highlightedyank'}
|
-- Used to display LSP status in Lualine
|
||||||
-- let g:highlightedyank_highlight_duration = 100
|
use {'nvim-lua/lsp-status.nvim'}
|
||||||
|
|
||||||
-- LSP / Language Server Protocol
|
--use {'simrat39/symbols-outline.nvim'}
|
||||||
use {
|
use {
|
||||||
'neovim/nvim-lspconfig',
|
'numToStr/Comment.nvim',
|
||||||
'williamboman/nvim-lsp-installer',
|
config = function()
|
||||||
}
|
require('Comment').setup()
|
||||||
|
end
|
||||||
use {'hrsh7th/cmp-nvim-lsp'}
|
}
|
||||||
use {'hrsh7th/cmp-buffer'}
|
-- Telescope fuzzy find files/grep
|
||||||
use {'hrsh7th/cmp-path'}
|
use {'nvim-lua/popup.nvim'}
|
||||||
use {'hrsh7th/cmp-cmdline'}
|
use {'nvim-lua/plenary.nvim'}
|
||||||
use {'hrsh7th/nvim-cmp'}
|
use {'nvim-telescope/telescope.nvim'}
|
||||||
use {'tzachar/cmp-tabnine', run = './install.sh'}
|
use {'nvim-telescope/telescope-project.nvim'}
|
||||||
use {'onsails/lspkind-nvim'} -- Display symbol with cmp suggestions
|
use {'nvim-telescope/telescope-fzy-native.nvim'}
|
||||||
use {'L3MON4D3/LuaSnip'}
|
|
||||||
use {'saadparwaiz1/cmp_luasnip'}
|
|
||||||
|
|
||||||
use {'glepnir/lspsaga.nvim'}
|
|
||||||
|
|
||||||
-- Used to display LSP status in Lualine
|
use {'theprimeagen/git-worktree.nvim'}
|
||||||
use {'nvim-lua/lsp-status.nvim'}
|
|
||||||
|
|
||||||
--use {'simrat39/symbols-outline.nvim'}
|
-- Debugging
|
||||||
use {
|
use("mfussenegger/nvim-dap")
|
||||||
'numToStr/Comment.nvim',
|
use("rcarriga/nvim-dap-ui")
|
||||||
config = function()
|
use("theHamsta/nvim-dap-virtual-text")
|
||||||
require('Comment').setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
-- Telescope fuzzy find files/grep
|
|
||||||
use {'nvim-lua/popup.nvim'}
|
|
||||||
use {'nvim-lua/plenary.nvim'}
|
|
||||||
use {'nvim-telescope/telescope.nvim'}
|
|
||||||
use {'nvim-telescope/telescope-project.nvim'}
|
|
||||||
use {'nvim-telescope/telescope-fzy-native.nvim'}
|
|
||||||
|
|
||||||
use {'theprimeagen/git-worktree.nvim'}
|
-- => Language Support
|
||||||
|
use {'rust-lang/rust.vim'}
|
||||||
|
use {'simrat39/rust-tools.nvim'}
|
||||||
|
use({ "mhanberg/elixir.nvim", requires = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim" }})
|
||||||
|
-- use {'JuliaEditorSupport/julia-vim', opt=true}
|
||||||
|
-- vim.g.latex_to_unicode_auto = 1
|
||||||
|
|
||||||
-- Debugging
|
-- themes & colorschemes
|
||||||
use("mfussenegger/nvim-dap")
|
use {'arcticicestudio/nord-vim'}
|
||||||
use("rcarriga/nvim-dap-ui")
|
use {'joshdick/onedark.vim'}
|
||||||
use("theHamsta/nvim-dap-virtual-text")
|
use {'gruvbox-community/gruvbox'}
|
||||||
|
use {'luisiacc/gruvbox-baby'}
|
||||||
-- => Language Support
|
end
|
||||||
use {'rust-lang/rust.vim'}
|
|
||||||
use {'simrat39/rust-tools.nvim'}
|
|
||||||
use({ "mhanberg/elixir.nvim", requires = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim" }})
|
|
||||||
-- use {'JuliaEditorSupport/julia-vim', opt=true}
|
|
||||||
-- vim.g.latex_to_unicode_auto = 1
|
|
||||||
|
|
||||||
-- themes & colorschemes
|
|
||||||
use {'arcticicestudio/nord-vim'}
|
|
||||||
use {'joshdick/onedark.vim'}
|
|
||||||
use {'gruvbox-community/gruvbox'}
|
|
||||||
use {'luisiacc/gruvbox-baby'}
|
|
||||||
end
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,10 +18,10 @@ vim.o.splitbelow = true -- Horizontal splits will automatically be below
|
|||||||
vim.o.termguicolors = true -- set term gui colors most terminals support this
|
vim.o.termguicolors = true -- set term gui colors most terminals support this
|
||||||
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
vim.o.splitright = true -- Vertical splits will automatically be to the right
|
||||||
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
vim.o.conceallevel = 0 -- So that I can see `` in markdown files
|
||||||
vim.cmd('set ts=4') -- Insert 4 spaces for a tab
|
vim.cmd('set ts=2') -- Insert 4 spaces for a tab
|
||||||
vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation
|
vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation
|
||||||
vim.cmd('set expandtab') -- Converts tabs to spaces
|
vim.cmd('set expandtab') -- Converts tabs to spaces
|
||||||
vim.bo.smartindent = true -- Makes indenting smart
|
vim.bo.smartindent = false -- Makes indenting smart
|
||||||
vim.wo.number = true -- set numbered lines
|
vim.wo.number = true -- set numbered lines
|
||||||
vim.wo.relativenumber = true -- set relative number
|
vim.wo.relativenumber = true -- set relative number
|
||||||
vim.wo.cursorline = true -- Enable highlighting of the current line
|
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
require('nvim-treesitter.configs').setup({
|
require('nvim-treesitter.configs').setup({
|
||||||
ensure_installed = { "python", "go", "elixir", "rust", "gomod", "json", "lua", "ruby", "yaml" },
|
ensure_installed = { "python", "go", "elixir", "rust", "gomod", "json", "lua", "ruby", "yaml" },
|
||||||
ignore_install = { "haskell" },
|
ignore_install = { "haskell" },
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true
|
enable = true
|
||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
enable = false
|
enable = true
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
init_selection = "gnn",
|
init_selection = "gnn",
|
||||||
node_incremental = "grn",
|
node_incremental = "grn",
|
||||||
scope_incremental = "grc",
|
scope_incremental = "grc",
|
||||||
node_decremental = "grm",
|
node_decremental = "grm",
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user