Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cursor layout #878

Merged
merged 18 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
…nvim into feat/add-cursor-layout
  • Loading branch information
Luxed committed Jul 12, 2021
commit 83a897a45145af71cde73f48ea123af35bac78af
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,11 @@ We have some built in themes but are looking for more cool options.

![dropdown](https://i.imgur.com/SorAcXv.png)

| Themes | Description |
|--------------------------|-----------------------------------------------------------------------|
| `themes.get_dropdown` | A list like centered list. [dropdown](https://i.imgur.com/SorAcXv.png)|
| `themes.get_cursor` | A cursor relative list. |
| `themes.get_ivy` | Bottom panel overlay. [Ivy #771](https://github.com/nvim-telescope/telescope.nvim/pull/771)|

| Themes | Description |
|--------------------------|---------------------------------------------------------------------------------------------|
| `themes.get_dropdown` | A list like centered list. [dropdown](https://i.imgur.com/SorAcXv.png) |
| `themes.get_cursor` | A cursor relative list. |
| `themes.get_ivy` | Bottom panel overlay. [Ivy #771](https://github.com/nvim-telescope/telescope.nvim/pull/771) |

To use a theme, simply append it to a built-in function:

Expand Down
308 changes: 33 additions & 275 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,257 +250,6 @@ telescope.extensions() *telescope.extensions()*



================================================================================
*telescope.themes*

Themes are ways to combine several elements of styling together.

They are helpful for managing the several differnt UI aspects for telescope and
provide a simple interface for users to get a particular "style" of picker.

themes.get_dropdown() *themes.get_dropdown()*
Dropdown style theme.

Usage:

`local builtin = require('telescope.builtin')`
`local themes = require('telescope.themes')`
`builtin.find_files(themes.get_dropdown())`



themes.get_cursor() *themes.get_cursor()*
Cursor style theme. Only to be used with cursor layout.

Usage:

`local builtin = require('telescope.builtin')`
`local themes = require('telescope.themes')`
`builtin.lsp_code_actions(themes.get_cursor())`



themes.get_ivy() *themes.get_ivy()*
Ivy style theme.

Usage:

`local builtin = require('telescope.builtin')`
`local themes = require('telescope.themes')`
`builtin.find_files(themes.get_ivy())`




================================================================================
*telescope.actions.set*

Telescope action sets are used to provide an interface for managing actions
that all primarily do the same thing, but with slight tweaks.

For example, when editing files you may want it in the current split, a
vertical split, etc. Instead of making users have to overwrite EACH of those
every time they want to change this behavior, they can instead replace the
`set` itself and then it will work great and they're done.

action_set.shift_selection({prompt_bufnr}, {change})*action_set.shift_selection()*
Move the current selection of a picker {change} rows. Handles not
overflowing / underflowing the list.


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{change} (number) The amount to shift the selection by


action_set.select({prompt_bufnr}, {type}) *action_set.select()*
Select the current entry. This is the action set to overwrite common
actions by the user.

By default maps to editing a file.


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{type} (string) The type of selection to make


action_set.edit({prompt_bufnr}, {command}) *action_set.edit()*
Edit a file based on the current selection.


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{command} (string) The command to use to open the file.


action_set.scroll_previewer({prompt_bufnr}, {direction})*action_set.scroll_previewer()*
Scrolls the previewer up or down


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr
{direction} (number) The direction of the scrolling



================================================================================
*telescope.actions*

Actions functions that are useful for people creating their own mappings.

actions.move_selection_next({prompt_bufnr}) *actions.move_selection_next()*
Move the selection to the next entry


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_selection_previous({prompt_bufnr})*actions.move_selection_previous()*
Move the selection to the previous entry


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_selection_worse({prompt_bufnr}) *actions.move_selection_worse()*
Move the selection to the entry that has a worse score


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_selection_better({prompt_bufnr})*actions.move_selection_better()*
Move the selection to the entry that has a better score


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_to_top({prompt_bufnr}) *actions.move_to_top()*
Move to the top of the picker


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_to_middle({prompt_bufnr}) *actions.move_to_middle()*
Move to the middle of the picker


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.move_to_bottom({prompt_bufnr}) *actions.move_to_bottom()*
Move to the bottom of the picker


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.add_selection({prompt_bufnr}) *actions.add_selection()*
Add current entry to multi select


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.remove_selection({prompt_bufnr}) *actions.remove_selection()*
Remove current entry from multi select


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.toggle_selection({prompt_bufnr}) *actions.toggle_selection()*
Toggle current entry status for multi select


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.git_create_branch({prompt_bufnr}) *actions.git_create_branch()*
Create and checkout a new git branch if it doesn't already exist


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.git_apply_stash({prompt_bufnr}) *actions.git_apply_stash()*
Applies an existing git stash


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.git_checkout({prompt_bufnr}) *actions.git_checkout()*
Checkout an existing git branch


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.git_track_branch({prompt_bufnr}) *actions.git_track_branch()*
Tell git to track the currently selected remote branch in Telescope


Parameters: ~
{prompt_bufnr} (number) The prompt bufnr


actions.send_selected_to_qflist() *actions.send_selected_to_qflist()*
Sends the selected entries to the quickfix list, replacing the previous
entries.



actions.add_selected_to_qflist() *actions.add_selected_to_qflist()*
Adds the selected entries to the quickfix list, keeping the previous
entries.



actions.send_to_qflist() *actions.send_to_qflist()*
Sends all entries to the quickfix list, replacing the previous entries.



actions.add_to_qflist() *actions.add_to_qflist()*
Adds all entries to the quickfix list, keeping the previous entries.



actions.smart_send_to_qflist() *actions.smart_send_to_qflist()*
Sends the selected entries to the quickfix list, replacing the previous
entries. If no entry was selected, sends all entries.



actions.smart_add_to_qflist() *actions.smart_add_to_qflist()*
Adds the selected entries to the quickfix list, keeping the previous
entries. If no entry was selected, adds all entries.



actions.open_qflist() *actions.open_qflist()*
Open the quickfix list




================================================================================
*telescope.builtin*

Expand Down Expand Up @@ -557,6 +306,22 @@ builtin.live_grep({opts}) *builtin.live_grep()*
Search for a string in your current working directory and get results live
as you type (respecting .gitignore)

<<<<<<< HEAD
themes.get_cursor() *themes.get_cursor()*
Cursor style theme. Only to be used with cursor layout.

Usage:

`local builtin = require('telescope.builtin')`
`local themes = require('telescope.themes')`
`builtin.lsp_code_actions(themes.get_cursor())`



themes.get_ivy() *themes.get_ivy()*
Ivy style theme.
=======
>>>>>>> 5692edd004fed1dbd55c90775c34a051298724e7

Parameters: ~
{opts} (table) options to pass to the picker
Expand Down Expand Up @@ -2196,6 +1961,21 @@ histories.History:reset() *histories.History:reset()*



histories.History:append({line}, {picker}, {no_reset})*histories.History:append()*
Append a new line to the history


Parameters: ~
{line} (string) current line that will be appended
{picker} (table) the current picker object
{no_reset} (boolean) On default it will reset the state at the end. If
you don't want to do this set to true


histories.History:get_next({line}, {picker}) *histories.History:get_next()*
Will return the next history item. Can be nil if there are no next items

<<<<<<< HEAD
layout_strategies.cursor() *layout_strategies.cursor()*
Cursor layout dynamically positioned below the cursor if possible.

Expand All @@ -2212,30 +1992,8 @@ layout_strategies.cursor() *layout_strategies.cursor()*

layout_strategies.vertical() *layout_strategies.vertical()*
Vertical perviewer stacks the items on top of each other.

+-----------------+
| Previewer |
| Previewer |
| Previewer |
+-----------------+
| Result |
| Result |
| Result |
+-----------------+
| Prompt |
+-----------------+


Parameters: ~
{line} (string) current line that will be appended
{picker} (table) the current picker object
{no_reset} (boolean) On default it will reset the state at the end. If
you don't want to do this set to true


histories.History:get_next({line}, {picker}) *histories.History:get_next()*
Will return the next history item. Can be nil if there are no next items

=======
>>>>>>> 5692edd004fed1dbd55c90775c34a051298724e7

Parameters: ~
{line} (string) the current line
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.