Changes from new updates, cleanup

This commit is contained in:
Salar Rahmanian 2021-11-07 13:24:41 -08:00
parent c12acd536a
commit c6e36add60
2 changed files with 35 additions and 41 deletions

View file

@ -40,8 +40,10 @@
programs.gh = {
enable = true;
editor = "nvim";
gitProtocol = "ssh";
settings = {
editor = "nvim";
git_protocol = "ssh";
};
};
programs.htop = {
@ -82,7 +84,6 @@
extensions = [
pkgs.vscode-extensions.scalameta.metals
pkgs.vscode-extensions.usernamehw.errorlens
pkgs.vscode-extensions.golang.Go
pkgs.vscode-extensions.redhat.java
pkgs.vscode-extensions.xyz.local-history
pkgs.vscode-extensions.yzhang.markdown-all-in-one
@ -155,7 +156,7 @@
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
set -xg PATH $HOME/bin $PATH
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
set -xg PATH /Users/salar/.luarocks/bin:/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/nix/store/3qp71mhrpxxg080yc82k51nx7b5hkajr-kitty-0.21.2/Applications/kitty.app/Contents/MacOS $PATH
@ -180,7 +181,7 @@
set -xg LUA_CPATH "?.so;/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/share/lua/5.1/?/init.lua;/Users/salar/.luarocks/lib/lua/5.1/?.so;/nix/store/95wpywsjf5iiw77f6n9rw347lk1sly15-luarocks-3.2.1/lib/lua/5.1/?.so"
'';
promptInit = ''
interactiveShellInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
@ -234,11 +235,8 @@
home.packages = [
pkgs.adoptopenjdk-bin
pkgs.any-nix-shell
pkgs.asciinema
pkgs.aspell
pkgs.awscli
pkgs.bloop
pkgs.cabal-install
pkgs.cmake
pkgs.coursier
pkgs.curlFull
@ -247,16 +245,11 @@
pkgs.exa
pkgs.fd
pkgs.ffmpeg
pkgs.ghcid
pkgs.gitAndTools.diff-so-fancy
pkgs.global
pkgs.gnupg
pkgs.gradle
pkgs.graphviz
pkgs.hlint
pkgs.httpie
pkgs.go
pkgs.hugo
pkgs.hyperfine
pkgs.jansson
pkgs.luajit
pkgs.luajitPackages.luarocks
@ -276,15 +269,17 @@
pkgs.nodePackages.yaml-language-server
pkgs.openssl
pkgs.pandoc
pkgs.pgcli
pkgs.prettyping
pkgs.procs
pkgs.python38Packages.debugpy
pkgs.ranger
pkgs.python3Full
pkgs.python39Packages.debugpy
pkgs.readline
pkgs.ripgrep
pkgs.ripgrep-all
pkgs.rnix-lsp
pkgs.rustup
pkgs.sbt
pkgs.scala-cli
pkgs.shellcheck
pkgs.stylua
pkgs.sumneko-lua-language-server

View file

@ -16,6 +16,7 @@ local function load_plugins()
use { 'folke/trouble.nvim', requires = 'kyazdani42/nvim-web-devicons' }
use { 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/popup.nvim' }, { 'nvim-lua/plenary.nvim' } } }
use 'nvim-telescope/telescope-dap.nvim'
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
use 'windwp/nvim-autopairs' -- Autopairs
use 'kyazdani42/nvim-tree.lua' -- File explorer
use {
@ -41,7 +42,6 @@ local function load_plugins()
use 'b3nj5m1n/kommentary'
use 'ckipp01/stylua-nvim'
use 'gennaro-tedesco/nvim-jqx'
use 'kristijanhusak/orgmode.nvim'
use 'p00f/nvim-ts-rainbow'
use 'christoomey/vim-tmux-navigator'
end)
@ -124,13 +124,6 @@ _G.load_config = function()
require('dap-python').test_runner = 'pytest'
-- orgmode.nvim
require('orgmode').setup({
org_agenda_files = {'~/Documents/org'},
org_default_notes_file = '~/Documents/org/notes.org'
})
-- nvim-tree
require('nvim-tree').setup()
@ -308,12 +301,19 @@ _G.load_config = function()
['<C-d>'] = false,
},
},
generic_sorter = require('telescope.sorters').get_fzy_sorter,
file_sorter = require('telescope.sorters').get_fzy_sorter,
file_ignore_patterns = { "node_modules", "target"}
file_ignore_patterns = { "node_modules", "target"},
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case"
}
}
},
}
require('telescope').load_extension('dap')
require('telescope').load_extension('fzf')
--Add leader shortcuts
vim.api.nvim_set_keymap('n', '<leader>f', [[<cmd>lua require('telescope.builtin').find_files()<cr>]], { noremap = true, silent = true })
@ -443,10 +443,10 @@ _G.load_config = function()
require('lspconfig').sumneko_lua.setup(luadev)
-- metals
vim.g.metals_server_version = '0.10.7+84-9d4bcf78-SNAPSHOT'
vim.opt_global.shortmess:remove('F'):append 'c'
Metals_config = require('metals').bare_config
Metals_config.settings = {
-- vim.g.metals_server_version = '0.10.7+84-9d4bcf78-SNAPSHOT'
-- vim.opt_global.shortmess:remove('F'):append 'c'
local metals_config = require('metals').bare_config()
metals_config.settings = {
showImplicitArguments = true,
showInferredType = true,
bloopSbtAlreadyInstalled = true,
@ -459,19 +459,19 @@ _G.load_config = function()
superMethodLensesEnabled = true,
javaHome = "/Users/salar/.nix-profile"
}
Metals_config.init_options.statusBarProvider = 'on'
Metals_config.on_attach = function(client, bufnr)
-- vim.cmd([[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]])
-- vim.cmd([[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]])
-- vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]])
metals_config.init_options.statusBarProvider = 'on'
metals_config.on_attach = function(client, bufnr)
vim.cmd([[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]])
vim.cmd([[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]])
vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]])
require("metals").setup_dap()
require("metals").setup_dap()
end
vim.cmd [[augroup lsp]]
vim.cmd [[au!]]
vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(Metals_config)]]
vim.cmd [[au FileType scala,sbt lua require("metals").initialize_or_attach(metals_config)]]
vim.cmd [[augroup end]]
-- Map :Format to vim.lsp.buf.formatting()
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]
@ -502,7 +502,6 @@ _G.load_config = function()
nvim_lua = true,
buffer = true,
luasnip = true,
orgmode = true,
tabnine = true,
},
}