Skip to content

Commit

Permalink
Merge pull request ayamir#9 from ayamir/develop
Browse files Browse the repository at this point in the history
[tools] add sniprun and its keymap.
  • Loading branch information
ayamir committed Aug 11, 2021
2 parents 0ac90a0 + 4773a42 commit 9bc3f78
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ Then you can figure out what modification makes error.
| [nvim-telescope/telescope-fzy-native.nvim](https://github.com/nvim-telescope/telescope-fzy-native.nvim) | Fzy search for telescope |
| [nvim-telescope/telescope-project.nvim](https://github.com/nvim-telescope/telescope-project.nvim) | Manage projects with telescope |
| [nvim-telescope/telescope-frecency.nvim](https://github.com/nvim-telescope/telescope-frecency.nvim) | Frequent and recent file cache |
| [thinca/vim-quickrun](https://github.com/thinca/vim-quickrun) | Run code quickly |
| [michaelb/sniprun](https://github.com/michaelb/sniprun) | Run code snippet quickly |
| [folke/trouble.nvim](https://github.com/folke/trouble.nvim) | Show code troubles etc |
| [folke/which-key.nvim](https://github.com/folke/which-key.nvim) | Help you learn keybindings |
| [dstein64/vim-startuptime](https://github.com/dstein64/vim-startuptime) | Profiling starup time quickly |
Expand All @@ -278,7 +280,6 @@ Then you can figure out what modification makes error.
| [easymotion/vim-easymotion](https://github.com/easymotion/vim-easymotion) | Powerful vim motion |
| [karb94/neoscroll.nvim](https://github.com/karb94/neoscroll.nvim) | smooth scroll |
| [vimlab/split-term](https://github.com/vimlab/split-term.vim) | Utilites around neovim's `:terminal` |
| [thinca/vim-quickrun](https://github.com/thinca/vim-quickrun) | Just run code quickly |

## Completion

Expand Down
4 changes: 3 additions & 1 deletion lua/keymap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ local plug_map = {
-- Plugin auto_session
["n|<leader>ss"] = map_cu('SaveSession'):with_noremap():with_silent(),
["n|<leader>sr"] = map_cu('RestoreSession'):with_noremap():with_silent(),
["n|<leader>sd"] = map_cu('DeleteSession'):with_noremap():with_silent()
["n|<leader>sd"] = map_cu('DeleteSession'):with_noremap():with_silent(),
-- Plugin SnipRun
["v|r"] = map_cr('SnipRun'):with_noremap():with_silent()
};

bind.nvim_load_mapping(plug_map)
1 change: 0 additions & 1 deletion lua/modules/editor/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ editor['karb94/neoscroll.nvim'] = {
config = conf.neoscroll
}
editor['vimlab/split-term.vim'] = {opt = true, cmd = {'Term', 'VTerm'}}
editor['thinca/vim-quickrun'] = {opt = true, cmd = {'QuickRun', 'Q'}}
editor['norcalli/nvim-colorizer.lua'] = {
opt = true,
event = 'BufRead',
Expand Down
28 changes: 28 additions & 0 deletions lua/modules/tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,32 @@ function config.trouble()
}
end

function config.sniprun()
require'sniprun'.setup({
selected_interpreters = {}, -- " use those instead of the default for the current filetype
repl_enable = {}, -- " enable REPL-like behavior for the given interpreters
repl_disable = {}, -- " disable REPL-like behavior for the given interpreters

interpreter_options = {}, -- " intepreter-specific options, consult docs / :SnipInfo <name>

-- " you can combo different display modes as desired
display = {
"Classic", -- "display results in the command-line area
"VirtualTextOk", -- "display ok results as virtual text (multiline is shortened)

"VirtualTextErr", -- "display error results as virtual text
-- "TempFloatingWindow", -- "display results in a floating window
"LongTempFloatingWindow" -- "same as above, but only long results. To use with VirtualText__
-- "Terminal" -- "display results in a vertical split
},

-- " miscellaneous compatibility/adjustement settings
inline_messages = 0, -- " inline_message (0/1) is a one-line way to display messages
-- " to workaround sniprun not being able to display anything

borders = 'shadow' -- " display borders around floating windows
-- " possible values are 'none', 'single', 'double', or 'shadow'
})
end

return config
6 changes: 6 additions & 0 deletions lua/modules/tools/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ tools['nvim-telescope/telescope-frecency.nvim'] = {
after = 'telescope.nvim',
requires = {{'tami5/sql.nvim', opt = true}}
}
tools['thinca/vim-quickrun'] = {opt = true, cmd = {'QuickRun', 'Q'}}
tools['michaelb/sniprun'] = {
opt = true,
run = 'bash ./install.sh',
cmd = {"SnipRun", "'<,'>SnipRun"}
}
tools['folke/which-key.nvim'] = {
config = function() require("which-key").setup {} end
}
Expand Down

0 comments on commit 9bc3f78

Please sign in to comment.