# Textadept config files
Yet another textadept config. This is especially made and tested for web development in php + html/css but hopefully could be dropped in to any use case. I have tried my best to make it similar to Atom/$ublime.

![alt text](https://notabug.org/reback00/ta-config/raw/master/assets/screenshot-02.png "Textadept running on this custom config")


## Features

- Tab switching with Ctrl+Tab
- Hot exit feature (remembers unsaved buffers on exit)
- Sets a dark theme (base16-default-dark)
- Sets tab as default
- Enables whitespace and wrap
- Adds right click menu to copy filename (under "Extra")
- Adds close tab on middle click*
- Creates or closes buffers on middle click or double click on empty space in tab bar (extremely convenient and fast)*
- Opens Find in Files result in new tab (unsplit view)*
- Highlights trailing whitespace at the end of lines
- Multi selection support to many keyboard shortcuts, such as delete lines, duplicate lines etc. (listed below in the Keyboard Shortcuts table)

\* Some features require patching and compiling. It should work without patches, but then those features will not be available. See `patches` directory for details.


## How to install/use

- Optional, but recommended: apply patches and install from source. Easy to follow instructions are provided in the `patches/README.md`.
- Or... install `textadept` from repo to use without patched features.
- For config, do either:

```bash
git clone --depth=1 https://notabug.org/reback00/ta-config.git ~/.textadept
```

or...

```bash
git clone --depth=1 https://notabug.org/reback00/ta-config.git
cd ta-config
mkdir -p ~/.textadept && cp -r {modules,themes,lexers,init.lua} ~/.textadept/
```

- Launch `textadept` and it should run with this config

__For dark interface:__

Edit/create this file:
- Linux: `~/.gtkrc-2.0` (sometimes can be `~/.gtkrc-2.0.mine` depending on distro)
- Windows: `textadept-install-folder\share\themes\MS-Windows\gtk-2.0\gtkrc`
- macOS: `Textadept.app/Contents/Resources/share/themes/Gnome-Cupertino/gtk-2.0/gtkrc`

with the following content:

```
style "custombg" {
bg[NORMAL] = "#555555"
fg[NORMAL] = "#BABABA"
}
widget "textadept*" style "custombg"
```

You can change the colors as you wish. `bg[NORMAL]` is background color and `fg[NORMAL]` is the text color in the interface. The color is in #BBGGRR format, not #RRGGBB. Idea from [here](https://foicica.com/wiki/change-statusbar-color).

For GTK+3:
`~/.config/gtk-3.0/gtk.css`
```css
#textadept * {
	background-color:#555555;
	color:#BABABA;
}
#textadept notebook {
	border:none;
}
#textadept trough {
	/* Set scrollbar background same as editor background */
	background-color:#272822;
}
#textadept slider {
	/* Set slider to be a bit brighter than default bg color set above */
	background-color:#888888;
}
```

See [this color reference](https://github.com/surajmandalcell/Gtk-Theming-Guide/blob/master/creating_gtk_themes.md#colors) for instructions on how to use color.

__For some features to work:__

Patch the source code and build. See, `patches` directory for details.


## Keyboard Shortcuts

| Shortcut       | Action                                                     |
|----------------|------------------------------------------------------------|
| Ctrl+Tab       | Switch between last used tabs.                             |
| Ctrl+Shift+Tab | Open list of recent / recently closed files.               |
| Ctrl+Page up   | Go to previous tab.                                        |
| Ctrl+Page Down | Go to next tab.                                            |
| Ctrl+Shift+K   | Delete line(s). Supports multi selection, multi cursor.    |
| Ctrl+D         | Duplicate line(s). Supports multi selection, multi cursor. |
| Ctrl+P         | Shows a list of possible commands.                         |
| Ctrl+G         | Go to a line.                                              |
| Ctrl+L         | Select line(s).                                            |
| Ctrl+J         | JavaDoc/PHPDoc comment.                                    |


## Events

These events are introduced by the patched compile:

- `TAB_MIDDLE_CLICK`: Runs when a tab is middle clicked.
- `TAB_MIDDLE_CLICK_BLANK`: Runs when middle clicked on blank space on tab bar.
- `TAB_DOUBLE_CLICK_BLANK`: Runs when double clicked on blank space on tab bar.

** Last tested in Textadept 10.8 under Linux 5.4 x86_64
