Welcome Guest, Not a member yet? Register   Sign In
Notepad++ Snippets
#1

[eluser]Michael Wales[/eluser]
I've recently become acquainted with Snippets thanks to giving eTextEditor and InType a try. Although the snippet functionality within these applications is much more powerful than the QuickText plugin provided with Notepad++ - those application just didn't "feel" right.

So, I took some time out tonight to create a snippet file for myself. This doesn't include every library within CodeIgniter - just the ones I use quite often.

If you would like to use these Snippets, copy-paste the text below at the top C:\Program Files\Notepad++\QuickText.ini file:

Code:
[1]
a=<?= anchor('$', '$'); ?>
cfgitem=\$this->config->item('$')
cfgset=\$this->config->set_item('$', '$')
ci_c=class $ extends Controller {\n\n    function __construct() {\n        parent::Controller();\n    }\n\n    function index() {\n        $\n    }\n\n}
ci_m=class $_m extends Model {\n\n    function __construct() {\n        parent::Model();\n    }\n\n    $\n\n}
dbcount=\$this->db->count_all('$');
dbdelete=\$this->db->delete('$', array($));
dbfrom=\$this->db->from('$');
dbget=\$this->db->get('$');
dbgetwhere=\$this->db->getwhere('$', array($));
dbgroup=\$this->db->groupby(array($));
dbhaving=\$this->db->having(array($));
dbinsert=\$insert = array($);\n\n\$this->db->insert('$', \$insert);
dbjoin=\$this->db->join('$', '$');
dblike=\$this->db->like(array($));
dblimit=\$this->db->limit($);
dborder=\$this->db->orderby('$');
dborlike=\$this->db->orlike(array($));
dborwhere=\$this->db->orwhere(array($));
dbselect=\$this->db->select('$');
dbset=\$this->db->set(array($));
dbupdate=\$update = array($);\n\n\$this->db->update('$', \$update);
dbwhere=\$this->db->where('$', array($));
e=echo '$';
email=\$msg = $;\n\n\$this->email->from('$', '$');\n\$this->email->to('$');\n\$this->email->subject('$');\n\$this->email->message(\$msg);\n\$this->email->send();
f=function $($) {\n    $\n}
f_=function _$($) {\n    $\n}
for=for ($, $, $) {\n    $\n}
foreach=foreach ($ as $) {\n    $\n}
form=<?= form_open('$'); ?>\n    $\n<?= form_close(); ?>
formm=<?= form_open_multipart('$'); ?>\n    $\n<?= form_close(); ?>
if=if ($) {\n    $\n}
ifelse=if ($) {\n    $\n} else {\n    $\n}
ifelseif=if ($) {\n    $\n} elseif ($) {\n    $\n} else {\n    $\n}
loadconfig=\$this->load->config('$');
loadhelper=\$this->load->helper('$');
loadlang=\$this->load->lang('$');
loadlib=\$this->load->library('$');
loadplugin=\$this->load->plugin('$');
loadview=\$this->load->view('$');
md5=\$this->security->dohash('$', 'md5');
p?=<?= $; ?>
php=<?php if (!defined('BASEPATH')) exit('No direct script access allowed');\n\n$\n\n?>
post=\$this->input->post('$');
r=redirect('$');
sdata=\$this->input->session('$');
sha1=\$this->security->dohash('$');
ssetdata=\$this->session->set_userdata(array($));
switch=switch ($) {\n    case '$':\n        $\n    default:\n        $\n}
upload=\$config['upload_path'] = '$';\n\$config['allowed_types'] = '$';\n\$this->load->library('upload', '\$config');\n\nif ($this->upload->do_upload()) {\n    $\n} else {\n    $\n}
val=if (\$this->validation->run()) {\n    $\n} else {\n    $\n}
valfield=\$fields['$'] = '$';
valrule=\$rules['$'] = '$';
valsetfields=\$this->validation->set_fields(\$fields);
valsetrule=\$this->validation->set_rules(\$rules);
while=while ($) {\n    $\n}


I was going to write out documentation for each of the shortcuts but it will take forever. Basically, review the text above - everything on the far left of the equal sign is the keyword, everything on the right is what will replace that keyword when you use the ctrl+enter combination.

I will be creating a PDF that can be printed out as a cheat sheet for these snippets. Once we have that and you spend some time with them and learn them, this should speed up your development significantly.


Messages In This Thread
Notepad++ Snippets - by El Forum - 11-20-2007, 01:58 AM
Notepad++ Snippets - by El Forum - 11-20-2007, 02:23 AM
Notepad++ Snippets - by El Forum - 11-20-2007, 02:39 AM
Notepad++ Snippets - by El Forum - 11-20-2007, 02:39 AM
Notepad++ Snippets - by El Forum - 11-20-2007, 02:57 AM
Notepad++ Snippets - by El Forum - 12-13-2007, 10:36 PM
Notepad++ Snippets - by El Forum - 12-13-2007, 11:40 PM
Notepad++ Snippets - by El Forum - 12-18-2007, 11:55 AM
Notepad++ Snippets - by El Forum - 10-01-2009, 02:46 AM
Notepad++ Snippets - by El Forum - 10-01-2009, 06:22 AM
Notepad++ Snippets - by El Forum - 10-01-2009, 06:39 AM
Notepad++ Snippets - by El Forum - 10-01-2009, 08:16 AM
Notepad++ Snippets - by El Forum - 10-02-2009, 08:50 AM
Notepad++ Snippets - by El Forum - 10-02-2009, 11:50 AM
Notepad++ Snippets - by El Forum - 10-02-2009, 12:02 PM
Notepad++ Snippets - by El Forum - 10-02-2009, 12:05 PM
Notepad++ Snippets - by El Forum - 10-02-2009, 12:19 PM
Notepad++ Snippets - by El Forum - 10-02-2009, 12:50 PM
Notepad++ Snippets - by El Forum - 09-19-2010, 09:17 PM
Notepad++ Snippets - by El Forum - 11-10-2012, 07:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB