mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-04-26 12:25:39 +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()
|
||||
end
|
||||
|
||||
-- require("theprimeagen.debugger.node");
|
||||
require("halfdan.debugger.elixir");
|
||||
|
||||
nnoremap("<Home>", function()
|
||||
dapui.toggle(1)
|
||||
|
@ -9,6 +9,8 @@ require('halfdan.colorscheme')
|
||||
require('halfdan.treesitter')
|
||||
require('halfdan.telescope')
|
||||
|
||||
require('halfdan.lualine')
|
||||
|
||||
require('halfdan.themes.nord')
|
||||
|
||||
require('halfdan.autocmds')
|
||||
|
@ -4,128 +4,127 @@ local fn = vim.fn
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
||||
execute "packadd packer.nvim"
|
||||
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
||||
execute "packadd packer.nvim"
|
||||
end
|
||||
|
||||
--- Check if a file or directory exists in this path
|
||||
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 .. "/"
|
||||
-- print('test '..plugin_path)
|
||||
local ok, err, code = os.rename(plugin_path, plugin_path)
|
||||
if not ok then
|
||||
if code == 13 then
|
||||
-- Permission denied, but it exists
|
||||
return true
|
||||
end
|
||||
local plugin_path = plugin_prefix .. plugin .. "/"
|
||||
-- print('test '..plugin_path)
|
||||
local ok, err, code = os.rename(plugin_path, plugin_path)
|
||||
if not ok then
|
||||
if code == 13 then
|
||||
-- Permission denied, but it exists
|
||||
return true
|
||||
end
|
||||
-- print(ok, err, code)
|
||||
if ok then
|
||||
vim.cmd("packadd " .. plugin)
|
||||
end
|
||||
return ok, err, code
|
||||
end
|
||||
-- print(ok, err, code)
|
||||
if ok then
|
||||
vim.cmd("packadd " .. plugin)
|
||||
end
|
||||
return ok, err, code
|
||||
end
|
||||
|
||||
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
||||
|
||||
return require("packer").startup(
|
||||
function(use)
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use "wbthomason/packer.nvim"
|
||||
function(use)
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use "wbthomason/packer.nvim"
|
||||
|
||||
use {'TimUntersberger/neogit' }
|
||||
use {'airblade/vim-gitgutter'}
|
||||
-- use {'andymass/vim-matchup'}
|
||||
use {'TimUntersberger/neogit' }
|
||||
use {'airblade/vim-gitgutter'}
|
||||
-- use {'andymass/vim-matchup'}
|
||||
|
||||
-- Load .editorconfig files
|
||||
use {'editorconfig/editorconfig-vim'}
|
||||
-- Load .editorconfig files
|
||||
use {'editorconfig/editorconfig-vim'}
|
||||
|
||||
use {'junegunn/vim-easy-align'}
|
||||
use {'junegunn/vim-easy-align'}
|
||||
|
||||
-- Goodies
|
||||
use {'tpope/vim-fugitive'}
|
||||
use {'tpope/vim-surround'} -- ✅
|
||||
use {'tpope/vim-dispatch'}
|
||||
-- Goodies
|
||||
use {'tpope/vim-fugitive'}
|
||||
use {'tpope/vim-surround'} -- ✅
|
||||
use {'tpope/vim-dispatch'}
|
||||
|
||||
-- Testing
|
||||
use {'vim-test/vim-test'}
|
||||
-- Testing
|
||||
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 {"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}
|
||||
use {"nvim-treesitter/nvim-treesitter-textobjects"}
|
||||
use {'justinmk/vim-sneak'}
|
||||
|
||||
use {'preservim/tagbar'}
|
||||
vim.g.tagbar_ctags_bin = '/usr/local/bin/ctags'
|
||||
use {'machakann/vim-highlightedyank'}
|
||||
-- let g:highlightedyank_highlight_duration = 100
|
||||
|
||||
-- Status Line and Bufferline
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons'}
|
||||
}
|
||||
-- LSP / Language Server Protocol
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
'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'}
|
||||
-- let g:highlightedyank_highlight_duration = 100
|
||||
-- Used to display LSP status in Lualine
|
||||
use {'nvim-lua/lsp-status.nvim'}
|
||||
|
||||
-- LSP / Language Server Protocol
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
'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 {'glepnir/lspsaga.nvim'}
|
||||
--use {'simrat39/symbols-outline.nvim'}
|
||||
use {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
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'}
|
||||
|
||||
-- Used to display LSP status in Lualine
|
||||
use {'nvim-lua/lsp-status.nvim'}
|
||||
use {'theprimeagen/git-worktree.nvim'}
|
||||
|
||||
--use {'simrat39/symbols-outline.nvim'}
|
||||
use {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
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'}
|
||||
-- Debugging
|
||||
use("mfussenegger/nvim-dap")
|
||||
use("rcarriga/nvim-dap-ui")
|
||||
use("theHamsta/nvim-dap-virtual-text")
|
||||
|
||||
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
|
||||
use("mfussenegger/nvim-dap")
|
||||
use("rcarriga/nvim-dap-ui")
|
||||
use("theHamsta/nvim-dap-virtual-text")
|
||||
|
||||
-- => 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
|
||||
|
||||
-- themes & colorschemes
|
||||
use {'arcticicestudio/nord-vim'}
|
||||
use {'joshdick/onedark.vim'}
|
||||
use {'gruvbox-community/gruvbox'}
|
||||
use {'luisiacc/gruvbox-baby'}
|
||||
end
|
||||
-- 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.splitright = true -- Vertical splits will automatically be to the right
|
||||
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 sw=4') -- Change the number of space characters inserted for indentation
|
||||
vim.cmd('set ts=2') -- Insert 4 spaces for a tab
|
||||
vim.cmd('set sw=2') -- Change the number of space characters inserted for indentation
|
||||
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.relativenumber = true -- set relative number
|
||||
vim.wo.cursorline = true -- Enable highlighting of the current line
|
||||
|
@ -1,19 +1,19 @@
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { "python", "go", "elixir", "rust", "gomod", "json", "lua", "ruby", "yaml" },
|
||||
ignore_install = { "haskell" },
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
indent = {
|
||||
enable = false
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
ensure_installed = { "python", "go", "elixir", "rust", "gomod", "json", "lua", "ruby", "yaml" },
|
||||
ignore_install = { "haskell" },
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "gnn",
|
||||
node_incremental = "grn",
|
||||
scope_incremental = "grc",
|
||||
node_decremental = "grm",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user